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

Prevent adding to a finished gauge #4306

Merged
merged 4 commits into from
Feb 14, 2023

Conversation

ValarDragon
Copy link
Member

What is the purpose of the change

@JeremyParish69 pointed out that there is currently a bug, where it is possible to add more rewards to an already finished gauge.

This PR fixes that as a bug vector.

Furthermore it also fixes a bug in IsFinishedGauge and IsActiveGauge, which is only used in InitGenesis logic

Brief Changelog

  • Prevent AddToGauge from succeeding on a Finished gauge, from which funds can never get distributed.
  • Fix an InitGenesis bug around ActiveGauge vs FinishedGauge classification

Testing and Verifying

This change adds a unit test to ensure it works.

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? yes
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? yes
  • How is the feature or change documented? N/A

@ValarDragon ValarDragon added the V:state/breaking State machine breaking PR label Feb 13, 2023
Copy link
Member

@p0mvn p0mvn left a comment

Choose a reason for hiding this comment

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

LGTM once the simulator is passing

@github-actions github-actions bot added the C:simulator Edits simulator or simulations label Feb 14, 2023
@ValarDragon ValarDragon merged commit cc90c10 into main Feb 14, 2023
@ValarDragon ValarDragon deleted the dev/prevent_add_to_gauge_on_finished_gauge branch February 14, 2023 07:57
@ValarDragon ValarDragon added the A:backport/v15.x backport patches to v15.x branch label Feb 14, 2023
mergify bot pushed a commit that referenced this pull request Feb 14, 2023
* Prevent adding to a finished gauge

* Add changelog

* Fix simulation

* Remove unneeded line

(cherry picked from commit cc90c10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v15.x backport patches to v15.x branch C:simulator Edits simulator or simulations C:x/incentives V:state/breaking State machine breaking PR
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants