Technical Guide
Intro
The purpose of this guide is to demonstrate how to perform Governance actions using the polkadot-js app
(or any other app that allows direct extrinsic call construction).
This knowledge isn't mandatory to use the dedicated governance UI, but can be very helpful to understand what's happening underneath the hood.
Extrinsic Calls Overview Per Actor
This chapter and subchapters will provide an overview of extrinsic calls used in the governance.
Collectives
All collectives, which include Main Council
, Technical Committee
and the Community Council
need to initiate & execute their calls via the pallet-collective interface.
execute
- allows a collective member to execute a call with a special origin as the member of the collective
- no voting, no delay
- e.g. this is used by the
Tech Committee
when they veto the external proposal made by theMain Council
propose
- proposes a call for voting to the collective
- needs to specify the voting threshold manually - user/UI needs to ensure they know this based on the proportion of aye votes required for the proposal to be passed
- e.g. if there are 5 collective members, and 2/3 is required for a motion to pass, the threshold should be set to 4
- from the code side, the proportion will need to be hardcoded, but member count can be read off the chain
- when a proposal is made, it will be assigned a unique
proposal index
, andhash
will be calculated from the actual proposal call- these values are important for further interaction with the proposal
vote
- collective member can vote to either approve or disapprove the proposal
- need to specify both the proposal hash and proposal index as emitted by the
propose
call - when an account votes for the first time (not changing the vote), the extrinsic call is free
close
- attempt to close the proposal, executing the call in case of the achieved approval or removing the proposal in case of rejection or expiry
- in case threshold hasn’t been achieved, but a prime logic is in place, and allocated
motion duration
has expired, missing votes might be derived from the prime strategy, and proposal will be closed - need to specify both the proposal hash and the proposal index as emitted by the
propose
call- in addition, also need to know the max weight of the proposal to execute & its encoded length
- unlike previous calls, can be called by any signed origin, no need to be part of the collective
- however, this account will pay the transaction fee for the execution
The pallet-collective-proxy is a special pallet that allows calls to be made on behalf of another account. It's similar to a proxy, but also works on collectives. It only has a single call that can be used:
execute_call
- wraps an extrinsic call, e.g. from the dApp staking pallet
- can only be successfully executed by the proxy account Id if collective decision has been reached
- in practice this means that when collective makes a proposal to execute a dApp staking action, they will need to wrap the dApp staking call into the
execute_call
Main Council
-
Democracy->externalPropose
- make an external proposal withsuper majority approve
voting scheme -
Democracy->externalProposeMajority
- make an external proposal withsimple majority
voting scheme -
Democracy->externalProposeDefault
- make an external proposal withsuper majority against
voting scheme -
Democracy->emergencyCancel
- cancel a referendum during the voting phase -
Treasury->rejectProposal
- reject the treasury spending proposal -
Treasury->approveProposal
- approve the treasury spending proposal
Technical Committee
Democracy->fastTrack
- fast-tracks an external proposalDemocracy->cancelProposal
- cancels a public proposalDemocracy->vetoExternal
- vetoes an external proposalDappStaking->maintenanceMode
- enable or disable maintenance modeSafeMode->forceEnter/forceExit
- enables/disables Safe Mode for the chainTxPause->pause/unpause
- pauses/unpauses specific transactions
Community Council
CollectiveProxy->executeCall(DappStaking->*)
- any dApp staking call related to token locking/staking can be executed by wrapping it into collective proxy callDappStaking->register
- register a new dApp into dApp stakingCommunityTreasury->rejectProposal
- reject the community treasury spending proposalCommunityTreasury->approveProposal
- approve the community treasury spending proposal