Mainer inactivity rules#107
Conversation
| private func handleMainerStatusAfterTopup() : Bool { | ||
| switch (mainerStatus) { | ||
| case (#Active) { return true; }; | ||
| case (#Inactive) { |
There was a problem hiding this comment.
Do we always want to return it back to Active status, or does the cycle balance need to go above the threshold first ?
Else it will just start cycling InActive > Active until next timer trigger > InActive
And the frontend will show all is ok until the next timer trigger while it is not.
There was a problem hiding this comment.
Keeping this responsibility on sufficientCyclesToProcessChallenge and thus in one place seems good to me
| switch (List.last<Types.MainerStatusEntry>(mainerInactiveEntries)) { | ||
| case (null) {}; // Continue | ||
| case (?earliestInactiveEntry) { | ||
| let mainerInactivityStateGracePeriod : Nat64 = 7 * 24 * 60 * 60 * 1_000_000_000; // 7 days in nanoseconds |
There was a problem hiding this comment.
What about making this a setting, global to the mAIner module, and make it dependent on the mAIner type?
Right now, we have the types:
- #ShareAgent
- #Own
And most likely I will propose to either rename Own or just create another type:
- #PowerMainer
The main difference between the ShareAgent & PowerMainer will be these settings.
There was a problem hiding this comment.
I made it a function that returns a value based on the agent type (getMainerInactivityStateGracePeriod); I think a setting updateable by a controller could be attacked (to get around the rules)
| switch (List.last<Types.MainerStatusEntry>(mainerCollapsingEntries)) { | ||
| case (null) {}; // Continue | ||
| case (?earliestCollapsingEntry) { | ||
| let mainerCollapsingStateGracePeriod : Nat64 = 14 * 24 * 60 * 60 * 1_000_000_000; // 14 days in nanoseconds |
There was a problem hiding this comment.
Same question as above, to make this a mAIner type dependent global setting.
There was a problem hiding this comment.
I made it a function that returns a value based on the agent type (getMainerCollapsingStateGracePeriod); I think a setting updateable by a controller could be attacked (to get around the rules)
No description provided.