17 major breaking releases

new 20.0.0 Jan 14, 2025
19.0.0 Sep 26, 2024
18.0.0 Jul 18, 2024
17.0.0 Jul 12, 2024
0.0.0 Aug 31, 2023

#415 in Magic Beans

Download history 166/week @ 2024-09-27 131/week @ 2024-10-04 122/week @ 2024-10-11 189/week @ 2024-10-18 176/week @ 2024-10-25 281/week @ 2024-11-01 14636/week @ 2024-11-08 25774/week @ 2024-11-15 24655/week @ 2024-11-22 23661/week @ 2024-11-29 26252/week @ 2024-12-06 24058/week @ 2024-12-13 7474/week @ 2024-12-20 9075/week @ 2024-12-27 20514/week @ 2025-01-03 22139/week @ 2025-01-10

63,014 downloads per month
Used in 10 crates (via polkadot-sdk)

Apache-2.0

2.5MB
41K SLoC

Release

Polkadot SDK Stable 2412


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–33MB
~542K SLoC