-
Notifications
You must be signed in to change notification settings - Fork 15
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: governance-pre-authorised-calls #3964
feat: governance-pre-authorised-calls #3964
Conversation
PRO-815 Governance pre-authorised calls
We need to be able to "pre-authorise" governance calls so that the governance council can prepare a 'big red button' safe mode extrinsic that can be dispatched by any governance council member. We can add a flag or option to the 'propose' extrinsic that modifies the behaviour such that the call will not be dispatched immediately but requires an explicit call to a new We still want to default to the old behaviour whereby the call is dispatched as soon as it passes the voting threshold. |
Codecov Report
@@ Coverage Diff @@
## main #3964 +/- ##
======================================
- Coverage 72% 72% -0%
======================================
Files 366 366
Lines 57082 57211 +129
Branches 57082 57211 +129
======================================
+ Hits 41210 41261 +51
- Misses 13786 13849 +63
- Partials 2086 2101 +15
... and 4 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Jan, looking good, just a couple of minor comments.
@@ -127,6 +129,11 @@ pub mod pallet { | |||
#[pallet::getter(fn gov_key_whitelisted_call_hash)] | |||
pub(super) type GovKeyWhitelistedCallHash<T> = StorageValue<_, GovCallHash, OptionQuery>; | |||
|
|||
/// Whitelisted pre authorised calls. | |||
#[pallet::storage] | |||
pub(super) type WhitelistedGovCalls<T> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use either whitelisted
or pre-authorised
, no need for two different words for the same thing.
@@ -65,11 +65,13 @@ pub mod pallet { | |||
pub call: OpaqueCall, | |||
/// Accounts who have already approved the proposal. | |||
pub approved: BTreeSet<AccountId>, | |||
/// Proposal is pre authorised. | |||
pub pre_authorised: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think an enum would make it clearer what the two options are (ie. automatic/implicit dispatch vs manual/explicit). Otherwise it's not immediately obvious that pre-authorised=false implies that the call will be automatically dispatched.
I made minor naming change + made it so that the Proposal doesn't need a default impl. |
Co-authored-by: Daniel <daniel@chainflip.io> Co-authored-by: dandanlen <3168260+dandanlen@users.noreply.github.com>
Co-authored-by: Daniel <daniel@chainflip.io> Co-authored-by: dandanlen <3168260+dandanlen@users.noreply.github.com>
Co-authored-by: Daniel <daniel@chainflip.io> Co-authored-by: dandanlen <3168260+dandanlen@users.noreply.github.com>
Pull Request
Closes: PRO-815
Checklist
Please conduct a thorough self-review before opening the PR.
Summary
Please include a succinct description of the purpose and content of the PR. What problem does it solve, and how? Link issues, discussions, other PRs, and anything else that will help the reviewer.