16 major breaking releases

19.0.0 Sep 26, 2024
18.0.0 Jul 18, 2024
17.0.0 Jul 12, 2024
16.0.0 Jun 24, 2024
0.0.0 Aug 31, 2023

#10 in #pause

Download history 30/week @ 2024-08-26 34/week @ 2024-09-02 28/week @ 2024-09-09 112/week @ 2024-09-16 258/week @ 2024-09-23 141/week @ 2024-09-30 125/week @ 2024-10-07 130/week @ 2024-10-14 200/week @ 2024-10-21 213/week @ 2024-10-28 256/week @ 2024-11-04 20247/week @ 2024-11-11 24366/week @ 2024-11-18 27483/week @ 2024-11-25 22431/week @ 2024-12-02 26918/week @ 2024-12-09

102,392 downloads per month
Used in 9 crates (via polkadot-sdk)

Apache-2.0

2MB
38K SLoC

Release

Polkadot SDK stable2409


lib.rs:

Transaction Pause

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

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

~18–32MB
~532K SLoC