You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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)
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)
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
The text was updated successfully, but these errors were encountered:
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:
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)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:osmosis/x/incentives/keeper/distribute.go
Lines 628 to 629 in 7c81b90
Leave a TODO to replace this
gaugeTime
with governance param uptime in #7371Testing 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:
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
The text was updated successfully, but these errors were encountered: