-
Notifications
You must be signed in to change notification settings - Fork 4
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
Control pallet major changes #89
Conversation
flow/src/types.rs
Outdated
Active = 1, | ||
Paused = 2, | ||
Finalizing = 3, | ||
Reverting = 4, |
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.
what if you get an issue while reverting?
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.
If you are asking from the perspective of having panic during on_initialize
- the whole chain will stop working.
If the question is about error handling in general, there are no expected issues (unreserve balance operation looks reliable enough). Not sure that I got the question.
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.
in case A there needs to be a way to recover. without that state recovering will be hard as you have to check all the balances, blocks and revert respecitvely.
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.
Is something wrong with the changes in the current PR?
Is something wrong with the design in general?
Currently, CampaignFinalizationQueue
holds information about what was scheduled and what was done. It doesn't differ too much from how it was implemented before. It's even easier to debug. No need to use indexes. Instead, there is a separate structure created only for queue handling.
@2075
93410a4
to
0c1e1e5
Compare
Ok(()) | ||
} | ||
|
||
/// Enable Org | ||
/// | ||
/// Enables an Org to be used and changes it's state to Active. | ||
/// Root origin only. |
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.
Probably specify Root or prime only.
?
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.
in that case the question is: who would disable e.g. a vote? why and how?
- root only exists now, later on there is not root
- a prime might have bad intensions, but could/should be able to lock an org if he wants to "have a break"
- usually this would be imposed by either a DAO internal council vote
- in case of bad actors, disabling could be imposed by a Protocol Council Vote, like a circuit breaker.
therefore it must be root, e.g. 3/4 majority council ( tbd as per last discussion @5-mark re majorities and quorums)
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.
@2075 I agree with these points.
However documentation should reflect current logic and not the one, which we would like to achieve in some future.
At the moment, voting is not yet implemented here. Once it will, we should update documentation accordingly.
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.
The design idea, as I understand it, is next:
- Control pallet interface allows direct changes for root or prime if
OrgType::Individual
. - Signal pallet interface allows indirect changes through governance mechanisms if
OrgType::Dao
- TBD.
@2075, does it make sense, or should we reconsider it?
And talking about the Control pallet scope (no governance involved), what's your suggestion here?
At the moment, the permissions model for Control pallet extrinsics is:
add_member
- root or primeremove_member
- root or primeenable_org
- root or primedisable_org
- root or primespend_funds
- root or prime
@2075, what should be changed here?
Also, ensure_root_or_prime
idea was partially discussed here #75 for the spend_funds
extrinsic, I've just extrapolated it for everything else.
cc: @5-mark
Self::deposit_event(Event::OrgEnabled(org_id)); | ||
Ok(()) | ||
} | ||
|
||
/// Disable Org | ||
/// | ||
/// Disables an Org to be used and changes it's state to Inactive. | ||
/// Root origin only. |
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.
Root or prime only.
?
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.
see response before
@vovacha / @2075 / @vasylenko-yevhen Findings on
|
good testing, should also drive the test cases in code. ✅ only controller of the organisation can run the ❓ account performing the ❓ accessModel contains 3 values: Open, Prime & Voting. Does ❌ I could change the prime to an account which is not member of the organisation.
❓ I could not test a scenario where funds are reserved. We dont have an extrinsic in currencies pallet to reserve funds like we have on balances pallet (eg see
|
I'll finalize this PR after the add/remove member discussion #85 (comment) has some outcomes. |
what about the root / prime / voting discussion? |
I've only created a discussion in the context of this PR, which is also about root and prime - #85 (comment) |
Backlog item created: #98 |
I'm going to merge it. |
Refactoring reasons: SBP-authored issues (storage, error handling), common naming convention (state names, errors, events, etc.)
Control new features:
OrgType::Individual
.Control refactoring: