Enabling Maintenance Mode¶
Introduction¶
The Maintenance pallet is a module that is designed for use only in emergencies that present existential threats to the network. Enabling maintenance mode on your network will suspend the processing of all regular transactions, including EVM interactions. Block production continues at a regular cadence and allows governance and staking functions to continue.
Maintenance mode filters (ignores) all calls outside of governance and staking. Once maintenance mode is exited, your chain will process any pending transactions that queued up while your chain was in maintenance mode. Maintenance mode is intended to be used only as a temporary, emergency measure.
For example, imagine discovering a critical exploit on your network that could result in significant financial losses if malicious actors exploit it. While you can address the issue by implementing a runtime upgrade, the process takes time—precious time during which your network remains vulnerable to attack. One potential solution is to activate maintenance mode on your network, complete the runtime upgrade, and exit maintenance mode once the fix has been verified.
Warning
Enabling maintenance mode on a production network can significantly impact the contracts on your chain. While maintenance mode is enabled, no smart contract transactions are processed, so it's critical to consider the potential ramifications before activating it.
Checking Prerequisites¶
For the examples in this guide, you will need to have the following:
- A Tanssi-powered network (Quick Trial or Dedicated)
- Your network's Sudo account connected to your network's Polkadot.js Apps. You can refer to the Managing Sudo guide for instructions on injecting your Sudo account into Polkadot.js Apps
If you're unsure what your Tanssi network's Sudo account is, you can find it in your Tanssi Dashboard underneath the Properties section.
Warning
It's critical to protect your Sudo account key with the utmost security precautions, as it grants privileged access to your Tanssi network.
Enabling Maintenance Mode¶
As you know, the Sudo account can perform privileged functions, such as enabling and disabling maintenance mode. To enter maintenance mode and stop regular transaction processing, navigate to the Developer tab of Polkadot.js Apps for your Tanssi-powered network and click on Sudo. If you do not see Sudo in this menu, you have not associated the Sudo account with Polkadot.js Apps. Make sure that your Sudo account is injected by your wallet and connected to Polkadot.js Apps. Then, take the following steps:
- Select the maintenanceMode pallet
- Select the enterMaintenanceMode method
- Press Submit Sudo and confirm the transaction in the resulting pop-up
To verify that maintenance mode has been enabled, you can check the Explorer section under the Network tab and review the recent events.
Exiting Maintenance Mode¶
To exit maintenance mode and return your network to normal operation, navigate to the Developer tab of Polkadot.js Apps for your Tanssi-powered network and click on Sudo. If you do not see Sudo in this menu, you have not associated the Sudo account with Polkadot.js Apps. Make sure that your Sudo account is injected by your wallet and connected to Polkadot.js Apps. Then, take the following steps:
- Select the maintenanceMode pallet
- Select the resumeNormalOperation method
- Press Submit Sudo and confirm the transaction in the resulting pop-up
To verify that maintenance mode has been disabled, you can check in the Explorer section under the Network tab and review the recent events.
Remember that using maintenance mode is an emergency action that should only be activated when your chain is at dire risk. It may be worthwhile to establish a policy for your network that sets specific circuit breaker triggers to determine when maintenance mode will be enabled. Establishing a policy in advance will also streamline decision-making during a potential emergency.
And that's it! The Developer Portal section has plenty more guides on how to manage your Tanssi-powered network.
| Created: March 28, 2024