Open armaniferrante opened 3 years ago
This is interesting! Should it use sysvar::clock()
?
Yes the clock sysvar should be used.
I don't think this can work in the runtime as implemented - the team mentioned the need for a sort of system-level cronjob.
Correct. One would need to trigger the program externally with a permissionless transaction. Even so, this is still very usefull. For example, one compelling use case is for one to compose a multisig program with a timelock program to perform program upgrades.
Looking at the multisig program, I was wondering if it could be generalized to a weighted threshold sig program, where the weight of each signature lives on an account controlled by a separate program - that for instance being a governance token.
So you point the generic program to the weighted address = weight + sig file. I guess similarly, multisig has to be deployed per set of sigs, since the authorisation model is that a particular program must sign off. I wonder if this inefficiency can be circumvented.
Hi @armaniferrante , I've recently shown how multisig program taken to its generic conclusion is equivalent to a pupeteer which can also schedule transactions at arbitrary times or recur them indefinitely.
You can take a look here: https://github.com/solana-labs/solana/issues/17218
@jon-chuang - do you have any implementation of this? I will need something like that in my program ;)
I'm interested in this use case but... how a "permissionless transaction" work to externally trigger the program? Can the program itself pay for the transaction using balance from a pda account? Or is the external party required to sign and pay for the transaction?
A useful example would be a timelock program that executes an arbitrary transaction at a specified point in time in the future.