-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add cron contract #3
Comments
I assume we want the cron contract on start up. An accept list for the contracts adds some complexity into the bootstrapping. If we want a "light" version for our contracts then we could decouple this with a new privilege so that we can use the sudo callback here for registration and also receiving triggers. I would expect this to become a Go module for better UX. A public available version would be more complex with tokenomics and CLI support. The contract registry may be handy here as well The original spike was using |
After reading this, I realise it is easier for privileged contracts to just implement end_block handlers and not try to centralise this. A cron job makes much more sense for permission less contracts who must pay gas and have some limits. I will remove this from 0.5 milestone and deal with it later as a "value added" contract |
@ethanfrey is this one still valid? From your previous response it seems like not. |
It is still a valid wish. But I think it will be a very useful feature. |
Great idea, but for another repo |
This is inspired by https://github.com/confio/priv_wasmd/pull/3 but using the new APIs, especially SubMsg.
The cron job will register as a BeginBlock Handler. One blocks with registered jobs, it will execute them (with a gas-limited sandbox) and store the result (ok or error) for future queries. Jobs that error will not automatically be re-run.
When registering a job, a user must pay upfront for the gas that will be used in the native fee token. This is converted to a gas allowance using the consensus minimum gas at the point of registration.
Requires confio/tgrade#7 for min gas
Update: more and more of our contracts want to do some delayed action. We should get a basic version of this working (with a whitelist of contracts that can set these jobs), so we don't keep adding the same logic everywhere.
We can add the more complex public gas-charging one later. See #113 and #136
The text was updated successfully, but these errors were encountered: