diff --git a/Cargo.lock b/Cargo.lock index 340396c3..b3db0305 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3186,7 +3186,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4890,7 +4890,7 @@ checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ "hermit-abi 0.5.0", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5810,9 +5810,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "lioness" @@ -6047,6 +6047,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", + "pallet-tx-pause", "pallet-utility", "pallet-vesting", "pallet-xcm", @@ -6184,9 +6185,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff70ce3e48ae43fa075863cef62e8b43b71a4f2382229920e0df362592919430" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", ] @@ -8026,6 +8027,20 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "pallet-tx-pause" +version = "21.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-stable2503#0c0d4ceba45a70f4e8dc40b1ee0cfae1fd759454" +dependencies = [ + "docify", + "pallet-balances", + "pallet-proxy", + "pallet-utility", + "parity-scale-codec", + "polkadot-sdk-frame", + "scale-info", +] + [[package]] name = "pallet-utility" version = "40.0.0" @@ -10080,7 +10095,7 @@ dependencies = [ "once_cell", "socket2 0.5.9", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -10706,7 +10721,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.4.15", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -10718,8 +10733,8 @@ dependencies = [ "bitflags 2.9.0", "errno", "libc", - "linux-raw-sys 0.9.3", - "windows-sys 0.52.0", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", ] [[package]] @@ -10787,7 +10802,7 @@ dependencies = [ "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -14309,7 +14324,7 @@ dependencies = [ "getrandom 0.3.2", "once_cell", "rustix 1.0.5", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -14385,6 +14400,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", + "pallet-tx-pause", "pallet-utility", "pallet-vesting", "pallet-xcm", @@ -15847,7 +15863,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -16295,9 +16311,9 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.25" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4" +checksum = "a62ce76d9b56901b19a74f19431b0d8b3bc7ca4ad685a746dfd78ca8f4fc6bda" [[package]] name = "xmltree" diff --git a/Cargo.toml b/Cargo.toml index cbb9da0c..299e2cd4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,7 +76,7 @@ pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", tag = pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false } pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false } pallet-democracy = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false } -pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false } #TODO check if was deleted from EPT +pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false } pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false } pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false } pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false } @@ -86,6 +86,7 @@ pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", tag = " pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false } pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false } +pallet-tx-pause = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false } pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false } pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false } pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false } diff --git a/runtime/mainnet/Cargo.toml b/runtime/mainnet/Cargo.toml index b23227b2..dad75a39 100644 --- a/runtime/mainnet/Cargo.toml +++ b/runtime/mainnet/Cargo.toml @@ -63,6 +63,7 @@ pallet-preimage = { workspace = true, default-features = false } pallet-scheduler = { workspace = true, default-features = false } pallet-treasury = { workspace = true, default-features = false } pallet-democracy = { workspace = true, default-features = false } +pallet-tx-pause = { workspace = true, default-features = false } pallet-vesting = { workspace = true, default-features = false } sp-api = { workspace = true, default-features = false } sp-block-builder = { workspace = true, default-features = false } @@ -146,6 +147,7 @@ std = [ "pallet-preimage/std", "pallet-scheduler/std", "pallet-treasury/std", + "pallet-tx-pause/std", "pallet-vesting/std", "parachain-info/std", "parachains-common/std", @@ -200,6 +202,7 @@ runtime-benchmarks = [ "pallet-scheduler/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-transaction-payment/runtime-benchmarks", + "pallet-tx-pause/runtime-benchmarks", "pallet-vesting/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", @@ -242,6 +245,7 @@ try-runtime = [ "pallet-proxy/try-runtime", "pallet-myth-proxy/try-runtime", "pallet-treasury/try-runtime", + "pallet-tx-pause/try-runtime", "pallet-vesting/try-runtime", "parachain-info/try-runtime", "pallet-escrow/try-runtime", diff --git a/runtime/mainnet/src/lib.rs b/runtime/mainnet/src/lib.rs index 4c44de94..55b2431f 100644 --- a/runtime/mainnet/src/lib.rs +++ b/runtime/mainnet/src/lib.rs @@ -380,6 +380,7 @@ impl frame_system::Config for Runtime { type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; /// The maximum number of consumers allowed on a single account. type MaxConsumers = frame_support::traits::ConstU32<16>; + type BaseCallFilter = TxPause; type SystemWeightInfo = weights::frame_system::WeightInfo; } @@ -1065,6 +1066,16 @@ impl pallet_treasury::Config for Runtime { type BenchmarkHelper = TreasuryBenchmarkHelper; } +impl pallet_tx_pause::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type PauseOrigin = RootOrCouncilTwoThirdsMajority; + type UnpauseOrigin = RootOrCouncilTwoThirdsMajority; + type WhitelistedCalls = (); + type MaxNameLen = ConstU32<256>; + type WeightInfo = weights::pallet_tx_pause::WeightInfo; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub struct Runtime { @@ -1112,6 +1123,7 @@ construct_runtime!( // Other pallets. Proxy: pallet_proxy = 40, Vesting: pallet_vesting = 41, + TxPause: pallet_tx_pause = 42, Escrow: pallet_escrow = 50, MythProxy: pallet_myth_proxy = 51, @@ -1142,6 +1154,7 @@ mod benches { [pallet_myth_proxy, MythProxy] [pallet_nfts, Nfts] [pallet_preimage, Preimage] + [pallet_tx_pause, TxPause] [pallet_proxy, Proxy] [pallet_session, SessionBench::] [pallet_scheduler, Scheduler] diff --git a/runtime/mainnet/src/weights/mod.rs b/runtime/mainnet/src/weights/mod.rs index e4294b4f..aff5888f 100644 --- a/runtime/mainnet/src/weights/mod.rs +++ b/runtime/mainnet/src/weights/mod.rs @@ -24,7 +24,6 @@ pub mod rocksdb_weights; pub use block_weights::constants::BlockExecutionWeight; pub use extrinsic_weights::constants::ExtrinsicBaseWeight; -//pub use paritydb_weights::constants::ParityDbWeight; pub use rocksdb_weights::constants::RocksDbWeight; pub mod cumulus_pallet_parachain_system; @@ -51,6 +50,7 @@ pub mod pallet_sudo; pub mod pallet_timestamp; pub mod pallet_transaction_payment; pub mod pallet_treasury; +pub mod pallet_tx_pause; pub mod pallet_utility; pub mod pallet_vesting; pub mod pallet_xcm; diff --git a/runtime/mainnet/src/weights/pallet_tx_pause.rs b/runtime/mainnet/src/weights/pallet_tx_pause.rs new file mode 100644 index 00000000..8a33bdd5 --- /dev/null +++ b/runtime/mainnet/src/weights/pallet_tx_pause.rs @@ -0,0 +1,64 @@ + +//! Autogenerated weights for `pallet_tx_pause` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 46.0.0 +//! DATE: 2025-03-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `blockdeep-ref-hw`, CPU: `AMD EPYC 7232P 8-Core Processor` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("mainnet-local-v")`, DB CACHE: 1024 + +// Executed Command: +// ./target/release/mythos-node +// benchmark +// pallet +// --chain +// mainnet-local-v +// --pallet +// pallet_tx_pause +// --extrinsic +// * +// --wasm-execution +// compiled +// --steps +// 50 +// --repeat +// 20 +// --output +// ./runtime/mainnet/src/weights/pallet_tx_pause.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_tx_pause`. +pub struct WeightInfo(PhantomData); +impl pallet_tx_pause::WeightInfo for WeightInfo { + /// Storage: `TxPause::PausedCalls` (r:1 w:1) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) + fn pause() -> Weight { + // Proof Size summary in bytes: + // Measured: `4` + // Estimated: `3997` + // Minimum execution time: 21_540_000 picoseconds. + Weight::from_parts(22_110_000, 0) + .saturating_add(Weight::from_parts(0, 3997)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `TxPause::PausedCalls` (r:1 w:1) + /// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`) + fn unpause() -> Weight { + // Proof Size summary in bytes: + // Measured: `566` + // Estimated: `3997` + // Minimum execution time: 29_360_000 picoseconds. + Weight::from_parts(30_750_000, 0) + .saturating_add(Weight::from_parts(0, 3997)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/runtime/testnet/Cargo.toml b/runtime/testnet/Cargo.toml index 635469e7..be1e87a8 100644 --- a/runtime/testnet/Cargo.toml +++ b/runtime/testnet/Cargo.toml @@ -60,6 +60,7 @@ pallet-multisig = { workspace = true, default-features = false } pallet-nfts = { workspace = true, default-features = false } pallet-proxy = { workspace = true, default-features = false } pallet-preimage = { workspace = true, default-features = false } +pallet-tx-pause = { workspace = true, default-features = false } pallet-vesting = { workspace = true, default-features = false } sp-api = { workspace = true, default-features = false } sp-block-builder = { workspace = true, default-features = false } @@ -138,6 +139,7 @@ std = [ "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", "pallet-treasury/std", + "pallet-tx-pause/std", "pallet-utility/std", "pallet-xcm/std", "pallet-proxy/std", @@ -195,6 +197,8 @@ runtime-benchmarks = [ "pallet-utility/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", + "pallet-transaction-payment/runtime-benchmarks", + "pallet-tx-pause/runtime-benchmarks", "pallet-vesting/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", @@ -234,6 +238,7 @@ try-runtime = [ "pallet-timestamp/try-runtime", "pallet-transaction-payment/try-runtime", "pallet-treasury/try-runtime", + "pallet-tx-pause/try-runtime", "pallet-utility/try-runtime", "pallet-xcm/try-runtime", "pallet-proxy/try-runtime", diff --git a/runtime/testnet/src/lib.rs b/runtime/testnet/src/lib.rs index 82e24f1f..57c96aca 100644 --- a/runtime/testnet/src/lib.rs +++ b/runtime/testnet/src/lib.rs @@ -391,6 +391,7 @@ impl frame_system::Config for Runtime { type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; /// The maximum number of consumers allowed on a single account. type MaxConsumers = frame_support::traits::ConstU32<16>; + type BaseCallFilter = TxPause; type SystemWeightInfo = weights::frame_system::WeightInfo; } @@ -1078,6 +1079,16 @@ impl pallet_treasury::Config for Runtime { type BenchmarkHelper = TreasuryBenchmarkHelper; } +impl pallet_tx_pause::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type PauseOrigin = RootOrCouncilTwoThirdsMajority; + type UnpauseOrigin = RootOrCouncilTwoThirdsMajority; + type WhitelistedCalls = (); + type MaxNameLen = ConstU32<256>; + type WeightInfo = weights::pallet_tx_pause::WeightInfo; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub struct Runtime { @@ -1125,6 +1136,7 @@ construct_runtime!( // Other pallets Proxy: pallet_proxy = 40, Vesting: pallet_vesting = 41, + TxPause: pallet_tx_pause = 42, Escrow: pallet_escrow = 50, MythProxy: pallet_myth_proxy = 51, @@ -1165,6 +1177,7 @@ mod benches { [pallet_utility, Utility] [pallet_collator_staking, CollatorStaking] [pallet_transaction_payment, TransactionPayment] + [pallet_tx_pause, TxPause] ); } diff --git a/runtime/testnet/src/weights/mod.rs b/runtime/testnet/src/weights/mod.rs index e4294b4f..aff5888f 100644 --- a/runtime/testnet/src/weights/mod.rs +++ b/runtime/testnet/src/weights/mod.rs @@ -24,7 +24,6 @@ pub mod rocksdb_weights; pub use block_weights::constants::BlockExecutionWeight; pub use extrinsic_weights::constants::ExtrinsicBaseWeight; -//pub use paritydb_weights::constants::ParityDbWeight; pub use rocksdb_weights::constants::RocksDbWeight; pub mod cumulus_pallet_parachain_system; @@ -51,6 +50,7 @@ pub mod pallet_sudo; pub mod pallet_timestamp; pub mod pallet_transaction_payment; pub mod pallet_treasury; +pub mod pallet_tx_pause; pub mod pallet_utility; pub mod pallet_vesting; pub mod pallet_xcm;