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]: Incorporate gov param in distribution logic #7371

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

[Uptime Incentives]: Incorporate gov param in distribution logic #7371

AlpinYukseloglu opened this issue Jan 25, 2024 · 0 comments · Fixed by #7419

Comments

@AlpinYukseloglu
Copy link
Contributor

AlpinYukseloglu commented Jan 25, 2024

Background

Once the gov param for internal incentives uptime is set up, we should ensure that the logic described in [issue above] is executed properly.

Suggested Design

This component should be quite straightforward to implement due to the decisions made in #7369, as properly handling internal gauge distributions would suffice to achieve the above. Specifically, adding a check to distributeInternal here:

if gauge.DistributeTo.LockQueryType == lockuptypes.NoLock {

that replaces gaugeTime with the gov param value if it is an internal gauge (& falls back to default if gov param is invalid) should work well. This check should be straightforward to do with logic similar to the following:

if distrToDenom != types.NoLockInternalGaugeDenom(poolId) {

Specifically, add the following logic under the first section above:

isInternalGauge := gauge.DistributeTo.Denom == types.NoLockInternalGaugeDenom(pool.GetId())
if isInternalGauge {
	gaugeTime = k.GetParams(ctx).InternalUptime
}

Testing Strategy

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

  • Empty gov param on internal gauge
  • Gov sets a value (should distribute to that uptime)
  • Gov sets a value and then changes it next epoch (2nd epoch distribution should be on the new uptime)
  • Gov sets value a supported but unauthorized uptime (should still work)
  • Gov sets value to an unsupported uptime (should not be possible, but if we sudo set params, it should fall back to default)

Acceptance Criteria

  • Gov param is tied into core logic as described and well tested
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
Development

Successfully merging a pull request may close this issue.

1 participant