-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update documentation for SafeMode and TxPause Pallets #2413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a5942dd
fa848aa
a6e48be
33083c7
5a921b9
f826ec9
bc04a8d
d8644f2
a1b7f6c
0db11e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,62 @@ | |
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| //! # 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. | ||
joepetrowski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| //! | ||
| //! ### 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. | ||
| //! | ||
ggwpez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| //! ### Example | ||
| //! | ||
| //! Configuration of call filters: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please also another simple example of how to use it, possibly by
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea this looks good. Maybe some more comments in the tests, but i think it works for a first version 👍 |
||
| //! | ||
| //! ```ignore | ||
| //! impl frame_system::Config for Runtime { | ||
| //! // … | ||
| //! type BaseCallFilter = InsideBoth<DefaultFilter, TxPause>; | ||
| //! // … | ||
| //! } | ||
| //! ``` | ||
| //! | ||
| //! Pause specific all: | ||
| #![doc = docify::embed!("src/tests.rs", can_pause_specific_call)] | ||
| //! | ||
| //! Unpause specific all: | ||
| #![doc = docify::embed!("src/tests.rs", can_unpause_specific_call)] | ||
| //! | ||
| //! Pause all calls in a pallet: | ||
| #![doc = docify::embed!("src/tests.rs", can_pause_all_calls_in_pallet_except_on_whitelist)] | ||
| //! | ||
| //! ## 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. | ||
joepetrowski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| #![cfg_attr(not(feature = "std"), no_std)] | ||
| #![deny(rustdoc::broken_intra_doc_links)] | ||
|
|
||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.