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: add update minCommissionRate to validators #1379

Merged
merged 12 commits into from
Sep 15, 2022
Merged

Conversation

gsk967
Copy link
Collaborator

@gsk967 gsk967 commented Sep 14, 2022

Description

This pull request contains the update staking minimum commission rate to all the validators whose validator commission rate below the minimum commission rate
closes: #1082


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
  • added appropriate labels to the PR
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • 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 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)

@gsk967 gsk967 changed the title upgrade: add update minCommissionRate to validators feat: add update minCommissionRate to validators Sep 14, 2022
Copy link
Member

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

  • We also need to update params by setting a params.MinCommissionRate
  • Let's move setMinimumCommissionRateToValidatros to another package and test it. I suggest app/upgrades/
  • test SetMinimumCommissionRateToValidatros. Ideally we should test it using mocks and only the staking keeper.

app/upgrades.go Outdated Show resolved Hide resolved
app/upgrades.go Outdated Show resolved Hide resolved
@gsk967 gsk967 marked this pull request as ready for review September 14, 2022 16:40
@gsk967 gsk967 requested review from a team as code owners September 14, 2022 16:40
app/upgrades.go Outdated Show resolved Hide resolved
app/upgrades.go Outdated Show resolved Hide resolved
app/upgrades.go Outdated Show resolved Hide resolved
app/upgrades.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Sep 15, 2022

Codecov Report

Merging #1379 (2f5a20b) into main (36e618b) will increase coverage by 0.49%.
The diff coverage is 96.10%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1379      +/-   ##
==========================================
+ Coverage   52.35%   52.84%   +0.49%     
==========================================
  Files          70       72       +2     
  Lines        6784     6861      +77     
==========================================
+ Hits         3552     3626      +74     
- Misses       2964     2966       +2     
- Partials      268      269       +1     
Impacted Files Coverage Δ
app/upgrades/min_commission.go 85.71% <85.71%> (ø)
app/upgrades/test_util.go 100.00% <100.00%> (ø)

Copy link
Member

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

pre approving. Make sure that files not needed for the app have _test.go suffix.

Also - maybe we can rename this directory to upgradesv3? What do you think?

app/upgrades/test_util.go Outdated Show resolved Hide resolved
@gsk967
Copy link
Collaborator Author

gsk967 commented Sep 15, 2022

pre approving. Make sure that files not needed for the app have _test.go suffix.

Also - maybe we can rename this directory to upgradesv3? What do you think?

How about we keep all v3 upgrade handlers related files inside app/upgrades/v3/

@gsk967 gsk967 requested a review from toteki September 15, 2022 14:35
@mergify mergify bot merged commit d9c8367 into main Sep 15, 2022
@mergify mergify bot deleted the sai/min_commission_rate branch September 15, 2022 15:05
@robert-zaremba
Copy link
Member

How about we keep all v3 upgrade handlers related files inside app/upgrades/v3/

I don't like import aliases, then you need to alias all imports, which is not really good. Also, this indicates as a v3 version of upgrades package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Min staking commission rate
4 participants