-
Notifications
You must be signed in to change notification settings - Fork 12
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
Feat: Multisig proposal minimum time and expiry time #208
Comments
I would love to see this added to the @arrudagates If you haven't already started working on this I would like to implement this myself. |
I haven't started this one yet, feel free to work on this if you'd like, all I ask is that you share how you plan to implement it and what architecture changes would be required to implement your approach! |
My plan is the following:
So essentially the pub struct MultisigOperation<AccountId, TallyOf, Call, Metadata, BlockNumber> {
pub tally: TallyOf,
pub original_caller: AccountId,
pub actual_call: Call,
pub call_metadata: [u8; 2],
pub call_weight: Weight,
pub expiry: Option<BlockNumber>,
pub min_passing: Option<BlockNumber>,
pub passing_since: Option<BlockNumber>,
pub submitted: BlockNumber,
pub metadata: Option<Metadata>,
} Of course, changes in |
This cannot be done in operate_multisig because minimum time and expiry time are security parameters imposed by the multisig, allowing members to arbitrarily set them per call would defeat their purpose. minimum_time and expiry_time should both be parameters of the Core, alongside required_approval and minimum_support, like this: pub struct CoreInfo<AccountId, CoreMetadataOf> {
pub account: AccountId,
pub metadata: CoreMetadataOf,
pub minimum_support: Perbill,
pub required_approval: Perbill,
pub frozen_tokens: bool,
pub minimum_time: u32,
pub expiry_time: u32,
} These would then be mutable by the multisig when calling set_parameters. Regarding minimum_time I actually think it would be a better user experience if it counted from the start, rather than from when the proposal becomes passing as that would quickly become very confusing (and exploitable) if members were to change their votes after it starts counting. For how to control these, I think a better approach is to add minimum_time and expiry_time to the MultisigOperation struct as pre-calculated blocks: minimum_block: current_block + minimum_time,
expiry_block: current_block + expiry_time, And then in vote_multisig these can be checked against the current block alongside the required_approval and minimum_support checks. Now there's still one thing that needs to be designed in order for all of this to work, and that is a "scheduler" of sorts. Basically we need to automatically dispatch calls once they hit the minimum_time, if the target block is reached and it's passing, and we also need to automatically clean up any expired call once the expiry block is reached. I was thinking of the following system:
Meanwhile there's a hook running at every block that checks both of these new storages. Edit: Forgot to mention but both of these parameters should also be optional, as it shouldn't be required for a multisig to have minimum proposal time or a proposal expiry time and these should be left for the members to decide, so in the end both of these parameters should be wrapped around |
Yeah, that makes sense. Counting from when it is passing sounds better but there can be some tricky edge cases so I do agree with you. Also, the reason why I wanted to start counting from when it is passing is because you mentioned it like this in the initial issue description:
I like the idea you mentioned in your comment. I think it is good to store the proposals in different storage at different stages. |
@arrudagates I don't think iterating over the ongoing multisigs in each block would be very scalable. IMO This could only work with some bounds on the number of ongoing multisig operations. Maybe a better idea would be to introduce new extrinsics that could handle ongoing multisigs. For example, we would have a new The same way we would have an |
Cores should be able to set the minimum amount of time a proposal should be open for (perhaps counting from when it passes the thresholds instead of from when it's open) before it's actually able to enact.
They should also be able to set an expiry time for automatically rejecting proposals in case they surpass this time without being approved.
Both of these parameters should also support the current behavior, which is no expiry time and no minimum lifetime.
The text was updated successfully, but these errors were encountered: