10 major breaking releases

13.0.0 Apr 9, 2024
12.0.0 Mar 18, 2024
11.0.0 Feb 26, 2024
10.0.0 Feb 13, 2024
0.0.0 Aug 31, 2023

#2057 in Magic Beans

Download history 7/week @ 2024-01-18 72/week @ 2024-02-08 738/week @ 2024-02-15 660/week @ 2024-02-22 218/week @ 2024-02-29 16/week @ 2024-03-07 99/week @ 2024-03-14 23/week @ 2024-03-21 13/week @ 2024-03-28 97/week @ 2024-04-04 22/week @ 2024-04-11

166 downloads per month

Apache-2.0

2MB
37K SLoC

Transaction Pause

Allows dynamic, chain-state-based pausing and unpausing of specific extrinsics via call filters.

WARNING

NOT YET AUDITED. DO NOT USE IN PRODUCTION.

Pallet API

See the pallet module for more information about the interfaces this pallet exposes, including its configuration trait, dispatchables, storage items, events, and errors.

Overview

A dynamic call filter that can be controlled with extrinsics.

Pausing an extrinsic means that the extrinsic CANNOT be called again until it is unpaused. The exception is calls that use dispatch_bypass_filter, typically only with the root origin.

Primary Features

  • Calls that should never be paused can be added to a whitelist.
  • Separate origins are configurable for pausing and pausing.
  • Pausing is triggered using the string representation of the call.
  • Pauses can target a single extrinsic or an entire pallet.
  • Pauses can target future extrinsics or pallets.

Example

Configuration of call filters:

impl frame_system::Config for Runtime {
  // …
  type BaseCallFilter = InsideBoth<DefaultFilter, TxPause>;
  // …
}

Pause specific all:

Unpause specific all:

Pause all calls in a pallet:

Low Level / Implementation Details

Use Cost

A storage map (PausedCalls) is used to store currently paused calls. Using the call filter will require a db read of that storage on each extrinsic.

Dependencies

~17–34MB
~546K SLoC