12 major breaking releases

new 15.0.0 May 23, 2024
14.0.0 May 1, 2024
13.0.0 Apr 9, 2024
12.0.0 Mar 18, 2024
0.0.0 Aug 31, 2023

#1945 in Magic Beans

Download history 481/week @ 2024-02-12 736/week @ 2024-02-19 456/week @ 2024-02-26 29/week @ 2024-03-04 3/week @ 2024-03-11 118/week @ 2024-03-18 4/week @ 2024-03-25 14/week @ 2024-04-01 117/week @ 2024-04-08 110/week @ 2024-04-29 1/week @ 2024-05-06 114/week @ 2024-05-20

225 downloads per month

Apache-2.0

2MB
38K 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–32MB
~539K SLoC