Expand description

A pallet to put your runtime into a restricted maintenance or safe mode. This is useful when performing site maintenance, running data migrations, or protecting the chain during an attack.

This introduces one storage read to fetch the base filter for each extrinsic. However, it should be that the state cache eliminates this cost almost entirely. I wonder if that can or should be reflected in the weight calculation.

Possible future improvements

  1. This could be more configurable by letting the runtime developer specify a type (probably an enum) that can be converted into a filter. Similar end result (but different implementation) as Acala has it github.com/AcalaNetwork/Acala/blob/pause-transaction/modules/transaction-pause/src/lib.rs#L71

  2. Automatically enable maintenance mode after a long timeout is detected between blocks. To implement this we would couple to the timestamp pallet and store the timestamp of the previous block.

  3. Different origins for entering and leaving maintenance mode.

  4. Maintenance mode timeout. To avoid getting stuck in maintenance mode. It could automatically switch back to normal mode after a pre-decided number of blocks. Maybe there could be an extrinsic to extend the maintenance time.

Re-exports

Modules

  • The pallet module in each FRAME pallet hosts the most important items needed to construct this pallet.

Structs