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(ante)!: Ante handler to add a maximum commission rate of 25% for validators. #1615

Merged
merged 3 commits into from
Oct 2, 2023

Conversation

Unique-Divine
Copy link
Member

Purpose

In our validator interviews, we found that a common strategy for "low-commission attacking" validators is to:

  1. Set a normal commission rate
  2. Then, change the commission rate to be extremely low to undercut the other validators and advertise for delegations
  3. And finally, adjust the commission extremely high to rake in profits with the new delegations.

If you impose a reasonable minimum and maximum commission, this problem is almost entirely avoided.

@Unique-Divine Unique-Divine requested a review from a team as a code owner October 1, 2023 20:36
@codecov
Copy link

codecov bot commented Oct 1, 2023

Codecov Report

Merging #1615 (ced79b2) into master (f1e92a5) will increase coverage by 0.07%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

❗ Current head ced79b2 differs from pull request most recent head 3e6873d. Consider uploading reports for the commit 3e6873d to get more accurate results

@@            Coverage Diff             @@
##           master    #1615      +/-   ##
==========================================
+ Coverage   74.18%   74.25%   +0.07%     
==========================================
  Files         165      167       +2     
  Lines       13177    13201      +24     
==========================================
+ Hits         9775     9803      +28     
+ Misses       2855     2850       -5     
- Partials      547      548       +1     
Files Coverage Δ
app/ante.go 54.00% <100.00%> (+0.93%) ⬆️
app/ante/commission.go 100.00% <100.00%> (ø)
app/ante/errors.go 100.00% <100.00%> (ø)
app/ante/fixed_gas.go 100.00% <100.00%> (ø)
x/common/testutil/cli/network.go 74.05% <100.00%> (ø)

... and 1 file with indirect coverage changes

expectedGas: 62504,
expectedGas: 62288,
Copy link
Member Author

Choose a reason for hiding this comment

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

Somehow, gas decreases due to this change. I have no idea why

@matthiasmatt matthiasmatt enabled auto-merge (squash) October 2, 2023 08:21
@matthiasmatt matthiasmatt merged commit 6c24125 into master Oct 2, 2023
14 checks passed
@matthiasmatt matthiasmatt deleted the realu/min-commission-2 branch October 2, 2023 08:27
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.

2 participants