feat: add cron module#663
Conversation
fragwuerdig
left a comment
There was a problem hiding this comment.
Overall looks good to me and follows upstream SDK principles. See my comments for details. The bullets that might have the best impact on the could would be:
- make sure contract executions cannot run over a given gas limit
- make error logging for failed contract executions more transparent and queryable
- clarify the behavior of
LastExecutedHeight
|
Can you explain what the actual benefit of this module would be as it could only be executed by governance? |
Sure thing: That could be useful for things like automated reward compounding, periodic liquidity management, TWAP/oracle updates, vesting or recurring payments, batch auctions/order matching, or other maintenance tasks that need reliable on-chain execution. So the value is decentralized, protocol-level automation while still keeping schedule creation gated by governance to prevent spam or abuse. |
Tbh I don't think that it would be used on this chain. I would greatly prefer a solution like @fragwuerdig had drafted which would be a more generic scheduler that could also be used by non-governance as long as fee is paid for. |
I don’t necessarily think a generic fee-based scheduler is automatically better. I think it solves a different problem. I understand the recurring fee model is likely meant to prevent spam, but that is a hard balance to get right. Fees need to be high enough to discourage low-value scheduled tasks, but low enough that legitimate projects can actually afford to use it. Projects would also still have to decide whether the scheduler adds enough value over simply submitting recurring transactions and paying normal gas fees. In some cases it may, but I don’t think it is automatically the better model. The governance-gated approach is more conservative, but that is also the point. It is better suited for protocol-level projects and teams that want to automate recurring tasks important to their service. Governance decides what is worth scheduling, and then the module handles execution automatically at the configured interval. Fees could still be part of the process if needed. For example, a fee could be paid up front before governance approves adding the task to the scheduler. I also know of at least one project that already has ideas for how they could use something like this. I won’t mention what they are working on, but real use cases are out there. |
I think frags approach would cover the mentioned use case and many more. A governance controlled scheduler would need any project to either fully renounce their contracts or the "chain" to trust that those contracts won't ever be altered to do something else than what was initially in there. Also who executes scheduled tasks should at least pay the gas required. |
Uh oh!
There was an error while loading. Please reload this page.