gelatodigital / gelato-network

V1 implementation of Gelato Network
https://gelato.network/
MIT License
231 stars 29 forks source link

Post-Audit: Checking minExecutorStake happens only on task submission and not on execution #206

Closed hilmarx closed 4 years ago

hilmarx commented 4 years ago

Effect:

Executors that are not min. staked any more do not get any new tasks assigned to them, because they e.g. did not top up after the minExecutorStake was increased. However in practice, I doubt that minStake will be made higher any time soon and otherwise executors can only unstake if they re-assigned all their providers to another executor.

Hence the only real use case I see for this check being in canSubmitTask, is that it is a sanity check for providers to have on their UI to see if they did indeed assign an executor and did not forget about it.

However, this could also easily be done off-chain.

hilmarx commented 4 years ago

This issue is tightly coupled to #205 and #204

gitpusha commented 4 years ago

Yes, I think the canSubmitTask function's main purpose is to be a convenience API for Providers to make all sorts of sanity checks easily before submitting a Task. This sanity check also includes a check that their currently assigned executor is minStaked or indeed that an executor is assigned at all.

gitpusha commented 4 years ago

I think we can keep it this way, as for example an Executor that is unwilling to increase his stake to match a new minExecutorStake requirement, should still retain the privilege to execute all the Tasks that he had been monitoring for maybe months, and then exit the system.

New Tasks cannot be assigned to him anyway during that "graceful exit" period.

gitpusha commented 4 years ago

Decision on phone with @hilmarx

Include in canExec

gitpusha commented 4 years ago

Included in #213 with commit 4994f5865699fcc3190a58f0aac6e2f265bd6aa7