Skip to content

Commit 2b4d871

Browse files
authored
Emergency pallets update (#758)
1 parent bab0cd0 commit 2b4d871

File tree

5 files changed

+73
-21
lines changed

5 files changed

+73
-21
lines changed
83.4 KB
Loading
163 KB
Loading

docs/learn/governance/index.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ In case the token holder votes correspond to the _winning_ side, their tokens wi
153153
| Minimum Public Referendum Deposit | 10 SBY | 1000 ASTR |
154154
| Simple Majority Proposal Origin | 1/2 Main Council | 2/3 Main Council |
155155
| Super Majority Against Proposal Origin | Unanimous Main Council | Unanimous Main Council |
156-
| Fast Track Origin | 1/2 Technical Committee | 2/3 Technical Committee |
157-
| Instant Track Origin | Unanimous Technical Committee | Unanimous Technical Committee |
156+
| Fast Track Origin | 1/2 Tech Committee | 2/3 Tech Committee |
157+
| Instant Track Origin | Unanimous Tech Committee | Unanimous Tech Committee |
158158
| Referendum Cancellation Origin | 1/2 Main Council | 2/3 Main Council |
159-
| Public Proposal Cancellation Origin | 1/2 Technical Committee | 2/3 Technical Committee |
159+
| Public Proposal Cancellation Origin | 1/2 Tech Committee | 2/3 Tech Committee |
160160

161161
#### Conviction Voting
162162

@@ -239,34 +239,37 @@ To check the current number of members, it is best to refer to the on-chain data
239239

240240
These parameters are related to the _dApp staking_ logic.
241241

242-
| Parameter Name | Shibuya | Astar |
243-
| --------------------------------------- | ------------------------ | ------------------------ |
244-
| dApp Register Origin | 1/2 Community Council | 2/3 Community Council |
245-
| dApp Unregister Origin | 4/5 Community Council | 4/5 Community Council |
246-
| Community Council Staking Operations | 1/2 Community Council | 2/3 Community Council |
242+
| Parameter Name | Shibuya | Astar |
243+
| --------------------------------------- | ------------------------ | ------------------------------------------- |
244+
| dApp Register Origin | 1/2 Community Council | 2/3 Community Council |
245+
| dApp Unregister Origin | 4/5 Community Council | 4/5 Community Council |
246+
| Community Council Staking Operations | 1/2 Community Council | 2/3 Community Council |
247+
| dApp Staking Maintenance Mode Origin | 1/2 Tech Committee | 1/2 Tech Committee or 2/3 Main Council |
247248

248249
### Emergency Maintenance Pallets
249250

250251
#### Safe Mode
251252

252-
The **SafeMode** pallet introduces an emergency STOP mechanism for the chain, restricting operations to a predefined set of permitted calls (only system calls). This mechanism is especially useful during chain anomalies or attacks. The `Technical Committee` can force-enter or exit _Safe Mode_. The _dApp staking_ maintenance mode is triggered when entering/exiting **Safe Mode**.
253+
The **SafeMode** pallet introduces an emergency STOP mechanism for the chain, restricting operations to a predefined set of permitted calls Operations like balance & asset transfer, smart contract calls, dApp staking operations aren't allowed. This mechanism is intended for severe situations like critical bugs or attacks. Both the `Tech Committee` and the `MainCouncil` can force-enter or exit _Safe Mode_. The _dApp staking_ maintenance mode is enabled/disabled when entering/exiting **Safe Mode**.
254+
255+
The _safe mode_ has a limited duration, but can be extended as many time as needed. However, it's not possible to put the entire chain into _safe mode_ indefinitely.
253256

254257
These parameters are related to the _Safe Mode_ logic.
255258

256-
| Parameter Name | Shibuya | Astar |
257-
| --------------------------------------- | ------------------------ | ------------------------ |
258-
| Enter Duration | 4 hours | TBD |
259-
| Extend Duration | 2 hours | TBD |
260-
| Force Enter Origin | 1/2 Technical Committee | TBD |
261-
| Force Exit Origin | 2/3 Technical Committee | TBD |
259+
| Parameter Name | Shibuya | Astar |
260+
| ------------------ | -------------------------------------------- | -------------------------------------------- |
261+
| Enter Duration | 4 hours | 12 hours |
262+
| Extend Duration | 2 hours | 4 hours |
263+
| Force Enter Origin | 1/2 Tech Committee or 2/3 Main Council | 1/2 Tech Committee or 2/3 Main Council |
264+
| Force Exit Origin | 1/2 Tech Committee or 2/3 Main Council | 1/2 Tech Committee or 2/3 Main Council |
262265

263266
#### Tx Pause
264267

265-
The **TxPause** pallet provides the ability to pause specific transaction calls dynamically. This feature is useful for mitigating issues with specific modules or calls without halting the entire chain. The `Technical Committee` can pause and resume individual calls dynamically as needed.
268+
The **TxPause** pallet provides the ability to pause specific transaction calls dynamically. This feature is useful for mitigating issues with specific modules or calls without halting the entire chain. This should be preferred to **SafeMode** in most cases as it is more precise & flexible. Both the `Tech Committee` and the `MainCouncil` can pause and resume individual calls dynamically as needed.
266269

267270
These parameters are related to the _Tx Pause_ logic.
268271

269-
| Parameter Name | Shibuya | Astar |
270-
| --------------------------------------- | ------------------------ | ------------------------ |
271-
| Pause Origin | 1/2 Technical Committee | TBD |
272-
| Unpause Origin | 1/2 Technical Committee | TBD |
272+
| Parameter Name | Shibuya | Astar |
273+
|----------------|---------------------------------------------|---------------------------------------------|
274+
| Pause Origin | 1/2 Tech Committee or 2/3 Main Council | 1/2 Tech Committee or 2/3 Main Council |
275+
| Unpause Origin | 1/2 Tech Committee or 2/3 Main Council | 1/2 Tech Committee or 2/3 Main Council |

docs/learn/governance/technical_guide.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,55 @@ The _pallet-collective-proxy_ is a special pallet that allows calls to be made o
8888
* `Treasury->proposeSpend` - proposes the spending of the main on-chain treasury funds (requires a deposit)
8989
* `CommunityTreasury->proposeSpend` - proposes the spending of the community treasury funds (requires a deposit)
9090

91+
### Emergency Situations
92+
93+
The following functions aren't tied to any specific actor, but at the moment of writing this guide, they are only callable by the `Technical Committee` or the `Main Council`.
94+
95+
#### Safe Mode
96+
97+
Intended to put the entire chain into _safe mode_, prohibiting any non-critical user transactions. This should only be used in case of a critical bug or vulnerability that needs to be fixed immediately.
98+
99+
* `SafeMode->forceEnter` - puts the chain into _safe mode_, preventing any non-critical transactions.
100+
* `SafeMode->forceExtend` - extends the _safe mode_ duration, allowing more time for the fix to be implemented. Can be used repeatedly to extend the _safe mode_ duration by a fixed amount.
101+
* `SafeMode->forceExit` - exits the _safe mode_.
102+
103+
#### Tx Pause
104+
105+
Intended to prohibit specific extrinsic calls. Similar to _safe mode_ but more precise & flexible. Caller is required to precisely specify pallet name (as integrated in the runtime) and the extrinsic call.
106+
107+
Integrated pallet names are defined in the runtime code, but can also be checked in `polkadot-js app` when selecting an extrinsic or state query. However, when checking the app, user needs to be aware that the first letter should be capitalized. For example, using the following image:
108+
109+
<Figure caption="Emergency - 1" src={require('/docs/learn/governance/img/19_Emergency/01_emergency.png').default } width="100%" />
110+
111+
we can observe pallets **assets** & **balances** but their actual names are **Assets** & **Balances**. This is important to note because if incorrect pallet name is specified, the call won't be properly filtered nor will the runtime inform the user that the call doesn't exist.
112+
113+
For the 2nd part, the extrinsic call name, it must be specified in _snake_case_.
114+
115+
This is exactly how it's defined in the pallet code, but the name can also be found using the `polkadot-js app`. When a pallet is selected under extrinsic selection, all extrinsic calls are listed but in _camelCase_. For example, using the following image:
116+
117+
<Figure caption="Emergency - 2" src={require('/docs/learn/governance/img/19_Emergency/02_emergency.png').default } width="100%" />
118+
119+
we can observe that pallet `Balances` has calls like `burn`, `forceTransfer` or `transferAll`. Transforming these into _snake_case_ we get `burn` (unchanged), `force_transfer` and `transfer_all`.
120+
121+
The pallet has only two calls.
122+
123+
* `TxPause->pause`
124+
* `TxPause->unpause`
125+
126+
Using all of the information presented so far, a few examples how these calls can be used:
127+
128+
* **TxPause->pause("Balances", "transfer_all")**
129+
* **TxPause->pause("DappStaking", "claim_unlocked")**
130+
* **TxPause->pause("Assets", "transfer_keep_alive")**
131+
132+
### dApp Staking
133+
134+
dApp staking has a `maintenance mode` which essentially disables all possible interactions with the pallet, and prevents eras from advancing (to prevent any further storage modifications). It can be enabled either by the `Tech Committee` or by the `Main Council`.
135+
136+
It's intended to be used when the dApp staking protocol has become compromised due to a bug or an attack.
137+
138+
* `DappStaking->maintenanceMode`
139+
91140
## User Guide
92141

93142
:::note

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@
6767
"node": ">=22.x"
6868
},
6969
"packageManager": "[email protected]"
70-
}
70+
}

0 commit comments

Comments
 (0)