-
Notifications
You must be signed in to change notification settings - Fork 11
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
Check if node have active contracts before changing the power target to down #924
Comments
Already live on mainnet so it can be closed |
So, the side effect of this is that nodes with leftover (free) network contracts can no longer be powered down by farmerbot. We have quite a few network contracts hanging around for whatever reasons, and of course this also represents a pretty serious abuse vector. The more logical thing to do is to actually check if any resources are reserved. I'm not sure if that's something we can comfortably do in the TF Chain runtime at each attempt to change power target to Down. If not, we need to come up with another approach. |
@scottyeager IMO the issue you are refer to has no thing to do with this issue or its related feature. |
What I'm saying is that there are two direct results of the changes described in this issue:
That's a big impact in exchange for fixing an issue that to me is not clearly described. So it's not clear to me what the overall impact is and whether that's a net positive, but I do think that side effects must be considered with any change. I don't think there was any ambiguity regarding what I meant by "network contract". Indeed I wasn't referring to any formally defined entity, but rather the matter of fact that our deployment tools create node contracts that exist solely to hold network workloads. It turns out we have to talk about these quite a bit, especially because it's also a matter of fact that such contracts tend to get left behind when workloads are destroyed, so having a convenient way to refer to these is important. Anyway, to me it's pretty simple: just let the node go to sleep if there aren't any resources reserved across all node contracts. It's true that network contracts are also used to include gateway nodes into user networks, so there could in theory be a node that has no resources reserved but is still doing useful work as a gateway. However, it would not make any sense for a farmer to configure a node as a gateway and then put it to sleep, so I think this possibility can be safely ignored. As for the idea of fixed costs per contract, to me it's not really a complete solution for this issue. Placing a cost on contracts will likely just result in users getting billed a bit more but never noticing it in many circumstances since it will get "rolled in" with the cost of any contracts that are actually reserving capacity. Most users just won't notice an extra $.2 per month in charges any more than they already notice they have extra contracts hanging around. It is true though that this would help substantially with point 2. |
Is your feature request related to a problem? Please describe
Currently, the farmer bot is responsible for verifying the active contracts before the node switches to low power mode, but this can cause data race issues.
Describe the solution you'd like
Check on
change_power_target
call if node have active contracts before changing the power target toDown
The text was updated successfully, but these errors were encountered: