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

[Uptime Incentives]: Use gauge duration as uptime with appropriate validation and fallback #7369

Closed
Tracked by #7366
AlpinYukseloglu opened this issue Jan 25, 2024 · 0 comments · Fixed by #7417
Closed
Tracked by #7366

Comments

@AlpinYukseloglu
Copy link
Contributor

AlpinYukseloglu commented Jan 25, 2024

Background

Since we are adding logic around state that might already exist, backwards compatibility is critical. Specifically, there are two cases we need to make sure we are covering, both of which can be addressed with proper validation checks in distribution logic:

  1. Existing CL/NoLock gauges with invalid “lock durations” (e.g. 0 seconds or nil) aren’t able to trigger unintended logic (e.g. an error/panic in epoch that can halt the chain, or even just trigger unintentional freezing of incentives)
  2. The ability of governance to revoke authorized uptimes has teeth (i.e. we guarantee that external gauges always distribute to authorized uptimes OR to some default value)

Suggested Design

Add the following validation logic to this line:
main...alpo/enable-uptime-gauges#diff-620e494b71d3ef447092659ad8b99835a3088760bb0924956007e88b3745f5bcR593-R608

Then, pass gaugeTime in instead of the default value here:

// Only default uptime is supported at launch.
types.DefaultConcentratedUptime,

Leave a TODO to replace this gaugeTime with governance param uptime in #7371

Testing Strategy

Some of the tests below will require implementing a helper that allows authorizing and unauthorizing uptimes. I'd suggest a simple helper that wraps a SetParams call to the CL module for test readability.

Add the following to existing distributeInternal tests related to CL/NoLock gauges:

  • If non authorized uptime, should fall back to default
  • If authorized uptime, should create a gauge with the authorized uptime
  • If gauge was created when uptime was authorized but later the uptime was unauthorized, should be creating default time incentive records
  • CL pool creation should never be blocked, even if epochDuration (1 day) is not an authorized or supported uptime (this is a placeholder value anyway, as distribution logic leans on the gov param)

Acceptance Criteria

  • Gauge logic for CL should be updated to reflect the above logic and tested as described
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
1 participant