-
Notifications
You must be signed in to change notification settings - Fork 355
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 listeners to cw4-group (and cw4?) #140
Comments
@alpe I would like your quick review on this. Not about rust, but about handling listeners (errors or out of gas), which we have discussed in the frame of cron jobs. Here we propose doing this atomically, so the However, maybe there is another architecture that is more like listeners that we could imagine. That we write all diffs to a local queue in the contract (no DoS possible here). And "somehow" the listener contracts are triggered to query that queue and take any action they want - each listener being run in separate tx, and separate from the original tx. If we have some way of isolating cron jobs / delayed tasks, and the called contract paying the gas to cover it, maybe the group can just request a future task for each listener, and these are run within that isolation, gas paid for my the listener. If we could actually design such a system in more than the "hand wavy" description I propose above, then this opens a lot of doors. Any contract could permissionlessly register as a listener to the group, as that action cannot effect the contract's execution at all. I try to define "hooks" (run atomically with the action, can abort it) from "listeners" (run asynchronously after the action is committed, cannot make changes). Hooks are obviously the easiest and what I will build in this PR, but after our discussions on cron service today, I am curious what you think about the listeners concept (and if you can define it better than I) |
@ethanfrey to separate hooks and listeners as separate concepts in designs is a good idea. I believe there are valid use cases for both types. The listeners are the more complex ones. |
We should allow multiple contracts to be informed of changing group membership. This is a key feature so we can remove the restriction of immutible groups from #80
UpdateMembers
is executed, all registered listeners will get sent a message of this update in the same transaction.Please code and test this in cw4-group, and update the cw4 spec to include this (both the types and the README)
Note, in some cases like #141 we may want to know both before and after weight for the changes, not just the new state. Consider how much overhead that information adds (do we need to make more queries? or do we make those already?) and what benefit it provides. You do not need to implement it, but please address this in the comments of the PR
The text was updated successfully, but these errors were encountered: