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

staking: use validator exchange rate to compute rewards #3803

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

erwanor
Copy link
Member

@erwanor erwanor commented Feb 12, 2024

Submitted for independent review and testing, should fix #3802.

Testing that this change work is a little bit tricky, here are the steps that I have taken just now:

  1. I setup a devnet with short block time (300ms), and short epoch durations (50 blocks).
  2. The default validator has 100% of the total active stake and a 100% commission rate.
  3. On the v0.66.0 tag, this experimental setups leads to a chain halt on epoch 2 (~ 25 seconds after start).

Copy link
Contributor

@cronokirby cronokirby left a comment

Choose a reason for hiding this comment

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

I gave this a thorough synchronous review with @erwanor, and am convinced that this is correct, and fixes other bugs beyond the circuit breaker, like a validator getting too much in commissions if slashed.

@cratelyn cratelyn added A-staking Area: Design and implementation of staking and delegation C-bug Category: a bug labels Feb 12, 2024
Copy link
Contributor

@cratelyn cratelyn left a comment

Choose a reason for hiding this comment

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

seconding the approval, as another participant in group review today. ⭐

@erwanor erwanor merged commit b2ca0f0 into main Feb 12, 2024
7 checks passed
@erwanor erwanor deleted the erwan/reward_amount_calculations branch February 12, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-staking Area: Design and implementation of staking and delegation C-bug Category: a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

staking: reward calculation exceeds issuance budget
3 participants