diff --git a/.github/workflows/release-21_build-runtimes.yml b/.github/workflows/release-21_build-runtimes.yml index 67d8c0b655683..7361c7de3387e 100644 --- a/.github/workflows/release-21_build-runtimes.yml +++ b/.github/workflows/release-21_build-runtimes.yml @@ -80,7 +80,7 @@ jobs: needs: [validate-inputs] uses: "./.github/workflows/release-srtool.yml" with: - excluded_runtimes: "asset-hub-rococo bridge-hub-rococo coretime-rococo people-rococo rococo rococo-parachain substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template polkadot-sdk-docs-first pallet-staking-async-parachain pallet-staking-async-rc frame-storage-access-test yet-another-parachain revive-dev" + excluded_runtimes: "asset-hub-rococo bridge-hub-rococo rococo substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template polkadot-sdk-docs-first pallet-staking-async-parachain pallet-staking-async-rc frame-storage-access-test yet-another-parachain revive-dev" build_opts: "--features on-chain-release-build" profile: production chain: ${{ inputs.chain }} diff --git a/.github/workflows/runtimes-matrix.json b/.github/workflows/runtimes-matrix.json index f47990217beb3..08c702f03270a 100644 --- a/.github/workflows/runtimes-matrix.json +++ b/.github/workflows/runtimes-matrix.json @@ -87,17 +87,6 @@ "uri": "wss://westend-collectives-rpc.polkadot.io:443", "is_relay": false }, - { - "name": "coretime-rococo", - "package": "coretime-rococo-runtime", - "path": "cumulus/parachains/runtimes/coretime/coretime-rococo", - "header": "cumulus/file_header.txt", - "template": "cumulus/templates/xcm-bench-template.hbs", - "bench_features": "runtime-benchmarks", - "bench_flags": "", - "uri": "wss://rococo-coretime-rpc.polkadot.io:443", - "is_relay": false - }, { "name": "coretime-westend", "package": "coretime-westend-runtime", @@ -120,17 +109,6 @@ "uri": null, "is_relay": false }, - { - "name": "people-rococo", - "package": "people-rococo-runtime", - "path": "cumulus/parachains/runtimes/people/people-rococo", - "header": "cumulus/file_header.txt", - "template": "cumulus/templates/xcm-bench-template.hbs", - "bench_features": "runtime-benchmarks", - "bench_flags": "", - "uri": "wss://rococo-people-rpc.polkadot.io:443", - "is_relay": false - }, { "name": "people-westend", "package": "people-westend-runtime", diff --git a/Cargo.lock b/Cargo.lock index 0f6150e8b800d..96742ae263dbc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1193,36 +1193,6 @@ dependencies = [ "testnet-parachains-constants", ] -[[package]] -name = "asset-hub-rococo-integration-tests" -version = "1.0.0" -dependencies = [ - "assert_matches", - "asset-test-utils", - "cumulus-pallet-parachain-system", - "emulated-integration-tests-common", - "frame-support", - "frame-system", - "pallet-asset-conversion", - "pallet-asset-rewards", - "pallet-assets", - "pallet-balances", - "pallet-message-queue", - "pallet-treasury", - "pallet-utility", - "pallet-xcm", - "parachains-common", - "parity-scale-codec", - "polkadot-runtime-common", - "rococo-runtime-constants", - "rococo-system-emulated-network", - "sp-core 28.0.0", - "sp-runtime", - "staging-xcm", - "staging-xcm-executor", - "xcm-runtime-apis", -] - [[package]] name = "asset-hub-rococo-runtime" version = "0.11.0" @@ -2591,7 +2561,6 @@ dependencies = [ "pallet-xcm", "parachains-common", "parity-scale-codec", - "rococo-system-emulated-network", "rococo-westend-system-emulated-network", "scale-info", "snowbridge-inbound-queue-primitives", @@ -3765,104 +3734,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "coretime-rococo-emulated-chain" -version = "0.1.0" -dependencies = [ - "coretime-rococo-runtime", - "cumulus-primitives-core", - "emulated-integration-tests-common", - "frame-support", - "parachains-common", - "sp-core 28.0.0", - "testnet-parachains-constants", -] - -[[package]] -name = "coretime-rococo-integration-tests" -version = "0.0.0" -dependencies = [ - "cumulus-pallet-parachain-system", - "emulated-integration-tests-common", - "frame-support", - "pallet-broker", - "pallet-message-queue", - "polkadot-runtime-parachains", - "rococo-runtime-constants", - "rococo-system-emulated-network", - "sp-runtime", - "staging-xcm", -] - -[[package]] -name = "coretime-rococo-runtime" -version = "0.1.0" -dependencies = [ - "cumulus-pallet-aura-ext", - "cumulus-pallet-parachain-system", - "cumulus-pallet-session-benchmarking", - "cumulus-pallet-weight-reclaim", - "cumulus-pallet-xcm", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-aura", - "cumulus-primitives-core", - "cumulus-primitives-utility", - "frame-benchmarking", - "frame-executive", - "frame-metadata-hash-extension", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "pallet-aura", - "pallet-authorship", - "pallet-balances", - "pallet-broker", - "pallet-collator-selection", - "pallet-message-queue", - "pallet-multisig", - "pallet-proxy", - "pallet-session", - "pallet-sudo", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-utility", - "pallet-xcm", - "pallet-xcm-benchmarks", - "parachains-common", - "parachains-runtimes-test-utils", - "parity-scale-codec", - "polkadot-parachain-primitives", - "polkadot-runtime-common", - "rococo-runtime-constants", - "scale-info", - "serde", - "serde_json", - "sp-api", - "sp-block-builder", - "sp-consensus-aura", - "sp-core 28.0.0", - "sp-genesis-builder", - "sp-inherents", - "sp-keyring", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-storage 19.0.0", - "sp-transaction-pool", - "sp-version", - "staging-parachain-info", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", - "substrate-wasm-builder", - "testnet-parachains-constants", - "tracing", - "xcm-runtime-apis", -] - [[package]] name = "coretime-westend-emulated-chain" version = "0.1.0" @@ -14758,103 +14629,6 @@ dependencies = [ "xcm-runtime-apis", ] -[[package]] -name = "people-rococo-emulated-chain" -version = "0.1.0" -dependencies = [ - "cumulus-primitives-core", - "emulated-integration-tests-common", - "frame-support", - "parachains-common", - "people-rococo-runtime", - "sp-core 28.0.0", - "testnet-parachains-constants", -] - -[[package]] -name = "people-rococo-integration-tests" -version = "0.1.0" -dependencies = [ - "asset-test-utils", - "emulated-integration-tests-common", - "frame-support", - "pallet-balances", - "parachains-common", - "rococo-system-emulated-network", - "sp-runtime", - "staging-xcm", - "staging-xcm-executor", -] - -[[package]] -name = "people-rococo-runtime" -version = "0.1.0" -dependencies = [ - "cumulus-pallet-aura-ext", - "cumulus-pallet-parachain-system", - "cumulus-pallet-session-benchmarking", - "cumulus-pallet-weight-reclaim", - "cumulus-pallet-xcm", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-aura", - "cumulus-primitives-core", - "cumulus-primitives-utility", - "enumflags2", - "frame-benchmarking", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-benchmarking", - "frame-system-rpc-runtime-api", - "frame-try-runtime", - "pallet-aura", - "pallet-authorship", - "pallet-balances", - "pallet-collator-selection", - "pallet-identity", - "pallet-message-queue", - "pallet-migrations", - "pallet-multisig", - "pallet-proxy", - "pallet-session", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-utility", - "pallet-xcm", - "pallet-xcm-benchmarks", - "parachains-common", - "parachains-runtimes-test-utils", - "parity-scale-codec", - "polkadot-parachain-primitives", - "polkadot-runtime-common", - "rococo-runtime-constants", - "scale-info", - "serde", - "serde_json", - "sp-api", - "sp-block-builder", - "sp-consensus-aura", - "sp-core 28.0.0", - "sp-genesis-builder", - "sp-inherents", - "sp-keyring", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-storage 19.0.0", - "sp-transaction-pool", - "sp-version", - "staging-parachain-info", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", - "substrate-wasm-builder", - "testnet-parachains-constants", - "tracing", - "xcm-runtime-apis", -] - [[package]] name = "people-westend-emulated-chain" version = "0.1.0" @@ -16233,7 +16007,6 @@ dependencies = [ "bridge-hub-westend-runtime", "collectives-westend-runtime", "color-eyre", - "coretime-rococo-runtime", "coretime-westend-runtime", "cumulus-client-consensus-aura", "cumulus-primitives-core", @@ -16242,10 +16015,8 @@ dependencies = [ "log", "parachains-common", "penpal-runtime", - "people-rococo-runtime", "people-westend-runtime", "polkadot-omni-node-lib", - "rococo-parachain-runtime", "sc-chain-spec", "sc-cli", "sc-service", @@ -19072,58 +18843,6 @@ dependencies = [ "sp-keyring", ] -[[package]] -name = "rococo-parachain-runtime" -version = "0.6.0" -dependencies = [ - "cumulus-pallet-aura-ext", - "cumulus-pallet-parachain-system", - "cumulus-pallet-weight-reclaim", - "cumulus-pallet-xcm", - "cumulus-pallet-xcmp-queue", - "cumulus-ping", - "cumulus-primitives-aura", - "cumulus-primitives-core", - "cumulus-primitives-utility", - "frame-benchmarking", - "frame-executive", - "frame-support", - "frame-system", - "frame-system-rpc-runtime-api", - "pallet-assets", - "pallet-aura", - "pallet-balances", - "pallet-message-queue", - "pallet-sudo", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-xcm", - "parachains-common", - "parity-scale-codec", - "polkadot-parachain-primitives", - "polkadot-runtime-common", - "scale-info", - "serde_json", - "sp-api", - "sp-block-builder", - "sp-consensus-aura", - "sp-core 28.0.0", - "sp-genesis-builder", - "sp-inherents", - "sp-keyring", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-transaction-pool", - "sp-version", - "staging-parachain-info", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", - "substrate-wasm-builder", -] - [[package]] name = "rococo-runtime" version = "7.0.0" @@ -19239,19 +18958,6 @@ dependencies = [ "staging-xcm-builder", ] -[[package]] -name = "rococo-system-emulated-network" -version = "0.0.0" -dependencies = [ - "asset-hub-rococo-emulated-chain", - "bridge-hub-rococo-emulated-chain", - "coretime-rococo-emulated-chain", - "emulated-integration-tests-common", - "penpal-emulated-chain", - "people-rococo-emulated-chain", - "rococo-emulated-chain", -] - [[package]] name = "rococo-westend-system-emulated-network" version = "0.0.0" diff --git a/Cargo.toml b/Cargo.toml index 135020c67e0db..539fa3162ca4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,26 +95,20 @@ members = [ "cumulus/parachains/integration-tests/emulated/chains/parachains/bridges/bridge-hub-rococo", "cumulus/parachains/integration-tests/emulated/chains/parachains/bridges/bridge-hub-westend", "cumulus/parachains/integration-tests/emulated/chains/parachains/collectives/collectives-westend", - "cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo", "cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-westend", - "cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo", "cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-westend", "cumulus/parachains/integration-tests/emulated/chains/parachains/testing/penpal", "cumulus/parachains/integration-tests/emulated/chains/relays/rococo", "cumulus/parachains/integration-tests/emulated/chains/relays/westend", "cumulus/parachains/integration-tests/emulated/common", - "cumulus/parachains/integration-tests/emulated/networks/rococo-system", "cumulus/parachains/integration-tests/emulated/networks/rococo-westend-system", "cumulus/parachains/integration-tests/emulated/networks/westend-system", - "cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo", "cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend", "cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo", "cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend", "cumulus/parachains/integration-tests/emulated/tests/collectives/collectives-westend", - "cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo", "cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-westend", "cumulus/parachains/integration-tests/emulated/tests/governance/westend", - "cumulus/parachains/integration-tests/emulated/tests/people/people-rococo", "cumulus/parachains/integration-tests/emulated/tests/people/people-westend", "cumulus/parachains/pallets/collective-content", "cumulus/parachains/pallets/parachain-info", @@ -133,14 +127,11 @@ members = [ "cumulus/parachains/runtimes/bridge-hubs/test-utils", "cumulus/parachains/runtimes/collectives/collectives-westend", "cumulus/parachains/runtimes/constants", - "cumulus/parachains/runtimes/coretime/coretime-rococo", "cumulus/parachains/runtimes/coretime/coretime-westend", "cumulus/parachains/runtimes/glutton/glutton-westend", - "cumulus/parachains/runtimes/people/people-rococo", "cumulus/parachains/runtimes/people/people-westend", "cumulus/parachains/runtimes/test-utils", "cumulus/parachains/runtimes/testing/penpal", - "cumulus/parachains/runtimes/testing/rococo-parachain", "cumulus/parachains/runtimes/testing/yet-another-parachain", "cumulus/polkadot-omni-node", "cumulus/polkadot-omni-node/lib", @@ -739,8 +730,6 @@ colored = { version = "2.0.4" } comfy-table = { version = "7.1.4", default-features = false } console = { version = "0.15.8" } const-hex = { version = "1.10.0", default-features = false } -coretime-rococo-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo" } -coretime-rococo-runtime = { path = "cumulus/parachains/runtimes/coretime/coretime-rococo" } coretime-westend-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-westend" } coretime-westend-runtime = { path = "cumulus/parachains/runtimes/coretime/coretime-westend" } cpu-time = { version = "1.0.0" } @@ -1113,8 +1102,6 @@ paste = { version = "1.0.15", default-features = false } pbkdf2 = { version = "0.12.2", default-features = false } penpal-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/parachains/testing/penpal" } penpal-runtime = { path = "cumulus/parachains/runtimes/testing/penpal" } -people-rococo-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo" } -people-rococo-runtime = { path = "cumulus/parachains/runtimes/people/people-rococo" } people-westend-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-westend" } people-westend-runtime = { path = "cumulus/parachains/runtimes/people/people-westend" } pin-project = { version = "1.1.3" } @@ -1210,10 +1197,8 @@ revm = { version = "27.0.2", default-features = false } ripemd = { version = "0.1.3", default-features = false } rlp = { version = "0.6.1", default-features = false } rococo-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/relays/rococo" } -rococo-parachain-runtime = { path = "cumulus/parachains/runtimes/testing/rococo-parachain" } rococo-runtime = { path = "polkadot/runtime/rococo" } rococo-runtime-constants = { path = "polkadot/runtime/rococo/constants", default-features = false } -rococo-system-emulated-network = { path = "cumulus/parachains/integration-tests/emulated/networks/rococo-system" } rococo-westend-system-emulated-network = { path = "cumulus/parachains/integration-tests/emulated/networks/rococo-westend-system" } rpassword = { version = "7.0.0" } rstest = { version = "0.18.2" } diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo/Cargo.toml b/cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo/Cargo.toml deleted file mode 100644 index b1d36003b17f2..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "coretime-rococo-emulated-chain" -version = "0.1.0" -authors.workspace = true -edition.workspace = true -license = "Apache-2.0" -description = "Coretime Rococo emulated chain" -publish = false - -[lints] -workspace = true - -[dependencies] -# Substrate -frame-support = { workspace = true } -sp-core = { workspace = true } - -# Cumulus -coretime-rococo-runtime = { workspace = true, default-features = true } -cumulus-primitives-core = { workspace = true } -emulated-integration-tests-common = { workspace = true } -parachains-common = { workspace = true, default-features = true } -testnet-parachains-constants = { features = ["rococo"], workspace = true, default-features = true } diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo/src/genesis.rs b/cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo/src/genesis.rs deleted file mode 100644 index f2035c8654d08..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo/src/genesis.rs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Substrate -use sp_core::storage::Storage; - -// Cumulus -use emulated_integration_tests_common::{ - accounts, build_genesis_storage, collators, SAFE_XCM_VERSION, -}; -use parachains_common::Balance; - -pub const PARA_ID: u32 = 1005; -pub const ED: Balance = testnet_parachains_constants::rococo::currency::EXISTENTIAL_DEPOSIT; - -pub fn genesis() -> Storage { - let genesis_config = coretime_rococo_runtime::RuntimeGenesisConfig { - system: coretime_rococo_runtime::SystemConfig::default(), - balances: coretime_rococo_runtime::BalancesConfig { - balances: accounts::init_balances().iter().cloned().map(|k| (k, ED * 4096)).collect(), - ..Default::default() - }, - parachain_info: coretime_rococo_runtime::ParachainInfoConfig { - parachain_id: PARA_ID.into(), - ..Default::default() - }, - collator_selection: coretime_rococo_runtime::CollatorSelectionConfig { - invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), - candidacy_bond: ED * 16, - ..Default::default() - }, - session: coretime_rococo_runtime::SessionConfig { - keys: collators::invulnerables() - .into_iter() - .map(|(acc, aura)| { - ( - acc.clone(), // account id - acc, // validator id - coretime_rococo_runtime::SessionKeys { aura }, // session keys - ) - }) - .collect(), - ..Default::default() - }, - polkadot_xcm: coretime_rococo_runtime::PolkadotXcmConfig { - safe_xcm_version: Some(SAFE_XCM_VERSION), - ..Default::default() - }, - ..Default::default() - }; - - build_genesis_storage( - &genesis_config, - coretime_rococo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - ) -} diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo/src/lib.rs b/cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo/src/lib.rs deleted file mode 100644 index 8d1ed3870d299..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo/src/lib.rs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -pub use coretime_rococo_runtime; - -pub mod genesis; - -// Substrate -use frame_support::traits::OnInitialize; - -// Cumulus -use emulated_integration_tests_common::{ - impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, - impls::Parachain, xcm_emulator::decl_test_parachains, AuraDigestProvider, -}; - -// CoretimeRococo Parachain declaration -decl_test_parachains! { - pub struct CoretimeRococo { - genesis = genesis::genesis(), - on_init = { - coretime_rococo_runtime::AuraExt::on_initialize(1); - }, - runtime = coretime_rococo_runtime, - core = { - XcmpMessageHandler: coretime_rococo_runtime::XcmpQueue, - LocationToAccountId: coretime_rococo_runtime::xcm_config::LocationToAccountId, - ParachainInfo: coretime_rococo_runtime::ParachainInfo, - MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, - DigestProvider: AuraDigestProvider, - }, - pallets = { - PolkadotXcm: coretime_rococo_runtime::PolkadotXcm, - Balances: coretime_rococo_runtime::Balances, - Broker: coretime_rococo_runtime::Broker, - } - }, -} - -// CoretimeRococo implementation -impl_accounts_helpers_for_parachain!(CoretimeRococo); -impl_assert_events_helpers_for_parachain!(CoretimeRococo); diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo/Cargo.toml b/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo/Cargo.toml deleted file mode 100644 index 5b83a4c9e0378..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "people-rococo-emulated-chain" -version = "0.1.0" -authors.workspace = true -edition.workspace = true -license = "Apache-2.0" -description = "People Rococo emulated chain" -publish = false - -[lints] -workspace = true - -[dependencies] -# Substrate -frame-support = { workspace = true } -sp-core = { workspace = true } - -# Cumulus -cumulus-primitives-core = { workspace = true } -emulated-integration-tests-common = { workspace = true } -parachains-common = { workspace = true, default-features = true } -people-rococo-runtime = { workspace = true } -testnet-parachains-constants = { features = ["rococo"], workspace = true, default-features = true } diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo/src/genesis.rs b/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo/src/genesis.rs deleted file mode 100644 index 9772a64d23b34..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo/src/genesis.rs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Substrate -use sp_core::storage::Storage; - -// Cumulus -use cumulus_primitives_core::ParaId; -use emulated_integration_tests_common::{ - accounts, build_genesis_storage, collators, SAFE_XCM_VERSION, -}; -use parachains_common::Balance; - -pub const PARA_ID: u32 = 1004; -pub const ED: Balance = testnet_parachains_constants::rococo::currency::EXISTENTIAL_DEPOSIT; - -pub fn genesis() -> Storage { - let genesis_config = people_rococo_runtime::RuntimeGenesisConfig { - system: people_rococo_runtime::SystemConfig::default(), - balances: people_rococo_runtime::BalancesConfig { - balances: accounts::init_balances().iter().cloned().map(|k| (k, ED * 4096)).collect(), - ..Default::default() - }, - parachain_info: people_rococo_runtime::ParachainInfoConfig { - parachain_id: ParaId::from(PARA_ID), - ..Default::default() - }, - collator_selection: people_rococo_runtime::CollatorSelectionConfig { - invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(), - candidacy_bond: ED * 16, - ..Default::default() - }, - session: people_rococo_runtime::SessionConfig { - keys: collators::invulnerables() - .into_iter() - .map(|(acc, aura)| { - ( - acc.clone(), // account id - acc, // validator id - people_rococo_runtime::SessionKeys { aura }, // session keys - ) - }) - .collect(), - ..Default::default() - }, - polkadot_xcm: people_rococo_runtime::PolkadotXcmConfig { - safe_xcm_version: Some(SAFE_XCM_VERSION), - ..Default::default() - }, - ..Default::default() - }; - - build_genesis_storage( - &genesis_config, - people_rococo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - ) -} diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo/src/lib.rs b/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo/src/lib.rs deleted file mode 100644 index 8557511816fe0..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/chains/parachains/people/people-rococo/src/lib.rs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -pub use people_rococo_runtime; - -pub mod genesis; - -// Substrate -use frame_support::traits::OnInitialize; - -// Cumulus -use emulated_integration_tests_common::{ - impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain, - impls::Parachain, xcm_emulator::decl_test_parachains, AuraDigestProvider, -}; - -// PeopleRococo Parachain declaration -decl_test_parachains! { - pub struct PeopleRococo { - genesis = genesis::genesis(), - on_init = { - people_rococo_runtime::AuraExt::on_initialize(1); - }, - runtime = people_rococo_runtime, - core = { - XcmpMessageHandler: people_rococo_runtime::XcmpQueue, - LocationToAccountId: people_rococo_runtime::xcm_config::LocationToAccountId, - ParachainInfo: people_rococo_runtime::ParachainInfo, - MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin, - DigestProvider: AuraDigestProvider, - }, - pallets = { - PolkadotXcm: people_rococo_runtime::PolkadotXcm, - Balances: people_rococo_runtime::Balances, - Identity: people_rococo_runtime::Identity, - IdentityMigrator: people_rococo_runtime::IdentityMigrator, - } - }, -} - -// PeopleRococo implementation -impl_accounts_helpers_for_parachain!(PeopleRococo); -impl_assert_events_helpers_for_parachain!(PeopleRococo); diff --git a/cumulus/parachains/integration-tests/emulated/networks/rococo-system/Cargo.toml b/cumulus/parachains/integration-tests/emulated/networks/rococo-system/Cargo.toml deleted file mode 100644 index 2f8889e481626..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/networks/rococo-system/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "rococo-system-emulated-network" -version = "0.0.0" -authors.workspace = true -edition.workspace = true -license = "Apache-2.0" -description = "Rococo System emulated network" -publish = false - -[lints] -workspace = true - -[dependencies] -# Cumulus -asset-hub-rococo-emulated-chain = { workspace = true } -bridge-hub-rococo-emulated-chain = { workspace = true } -coretime-rococo-emulated-chain = { workspace = true } -emulated-integration-tests-common = { workspace = true } -penpal-emulated-chain = { workspace = true } -people-rococo-emulated-chain = { workspace = true } -rococo-emulated-chain = { workspace = true } diff --git a/cumulus/parachains/integration-tests/emulated/networks/rococo-system/src/lib.rs b/cumulus/parachains/integration-tests/emulated/networks/rococo-system/src/lib.rs deleted file mode 100644 index 53808bc5a8010..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/networks/rococo-system/src/lib.rs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -pub use asset_hub_rococo_emulated_chain; -pub use bridge_hub_rococo_emulated_chain; -pub use coretime_rococo_emulated_chain; -pub use penpal_emulated_chain; -pub use people_rococo_emulated_chain; -pub use rococo_emulated_chain; - -use asset_hub_rococo_emulated_chain::AssetHubRococo; -use bridge_hub_rococo_emulated_chain::BridgeHubRococo; -use coretime_rococo_emulated_chain::CoretimeRococo; -use penpal_emulated_chain::{PenpalA, PenpalB}; -use people_rococo_emulated_chain::PeopleRococo; -use rococo_emulated_chain::Rococo; - -// Cumulus -use emulated_integration_tests_common::{ - accounts::{ALICE, BOB}, - xcm_emulator::{decl_test_networks, decl_test_sender_receiver_accounts_parameter_types}, -}; - -decl_test_networks! { - pub struct RococoMockNet { - relay_chain = Rococo, - parachains = vec![ - AssetHubRococo, - BridgeHubRococo, - CoretimeRococo, - PenpalA, - PenpalB, - PeopleRococo, - ], - bridge = () - }, -} - -decl_test_sender_receiver_accounts_parameter_types! { - RococoRelay { sender: ALICE, receiver: BOB }, - AssetHubRococoPara { sender: ALICE, receiver: BOB }, - BridgeHubRococoPara { sender: ALICE, receiver: BOB }, - CoretimeRococoPara { sender: ALICE, receiver: BOB }, - PenpalAPara { sender: ALICE, receiver: BOB }, - PenpalBPara { sender: ALICE, receiver: BOB }, - PeopleRococoPara { sender: ALICE, receiver: BOB } -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/Cargo.toml b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/Cargo.toml deleted file mode 100644 index 3e0161aaa8f8f..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/Cargo.toml +++ /dev/null @@ -1,43 +0,0 @@ -[package] -name = "asset-hub-rococo-integration-tests" -version = "1.0.0" -authors.workspace = true -edition.workspace = true -license = "Apache-2.0" -description = "Asset Hub Rococo runtime integration tests with xcm-emulator" -publish = false - -[lints] -workspace = true - -[dependencies] -assert_matches = { workspace = true } -codec = { workspace = true } - -# Substrate -frame-support = { workspace = true } -frame-system = { workspace = true } -pallet-asset-conversion = { workspace = true } -pallet-asset-rewards = { workspace = true } -pallet-assets = { workspace = true } -pallet-balances = { workspace = true } -pallet-message-queue = { workspace = true } -pallet-treasury = { workspace = true } -pallet-utility = { workspace = true } -sp-core = { workspace = true } -sp-runtime = { workspace = true } - -# Polkadot -pallet-xcm = { workspace = true } -polkadot-runtime-common = { workspace = true, default-features = true } -rococo-runtime-constants = { workspace = true, default-features = true } -xcm = { workspace = true } -xcm-executor = { workspace = true } -xcm-runtime-apis = { workspace = true, default-features = true } - -# Cumulus -asset-test-utils = { workspace = true, default-features = true } -cumulus-pallet-parachain-system = { workspace = true } -emulated-integration-tests-common = { workspace = true } -parachains-common = { workspace = true, default-features = true } -rococo-system-emulated-network = { workspace = true } diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/lib.rs deleted file mode 100644 index 48fc23b268c4c..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/lib.rs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#[cfg(test)] -mod imports { - pub(crate) use codec::Encode; - - // Substrate - pub(crate) use frame_support::{ - assert_err, assert_ok, - pallet_prelude::Weight, - sp_runtime::{DispatchError, DispatchResult, ModuleError}, - traits::fungibles::Inspect, - }; - - // Polkadot - pub(crate) use xcm::{ - latest::{ROCOCO_GENESIS_HASH, WESTEND_GENESIS_HASH}, - prelude::{AccountId32 as AccountId32Junction, *}, - }; - pub(crate) use xcm_executor::traits::TransferType; - - // Cumulus - pub(crate) use asset_test_utils::xcm_helpers; - pub(crate) use emulated_integration_tests_common::{ - accounts::DUMMY_EMPTY, - test_parachain_is_trusted_teleporter, test_parachain_is_trusted_teleporter_for_relay, - test_relay_is_trusted_teleporter, test_xcm_fee_querying_apis_work_for_asset_hub, - xcm_emulator::{ - assert_expected_events, bx, Chain, Parachain as Para, RelayChain as Relay, Test, - TestArgs, TestContext, TestExt, - }, - xcm_helpers::{ - fee_asset, get_amount_from_versioned_assets, non_fee_asset, xcm_transact_paid_execution, - }, - PenpalATeleportableAssetLocation, ASSETS_PALLET_ID, RESERVABLE_ASSET_ID, XCM_V3, - }; - pub(crate) use parachains_common::Balance; - pub(crate) use rococo_system_emulated_network::{ - asset_hub_rococo_emulated_chain::{ - asset_hub_rococo_runtime::{ - self, - xcm_config::{ - self as ahr_xcm_config, TokenLocation as RelayLocation, TreasuryAccount, - XcmConfig as AssetHubRococoXcmConfig, - }, - AssetConversionOrigin as AssetHubRococoAssetConversionOrigin, - ExistentialDeposit as AssetHubRococoExistentialDeposit, - }, - genesis::{AssetHubRococoAssetOwner, ED as ASSET_HUB_ROCOCO_ED}, - AssetHubRococoParaPallet as AssetHubRococoPallet, - }, - penpal_emulated_chain::{ - penpal_runtime::xcm_config::{ - CustomizableAssetFromSystemAssetHub as PenpalCustomizableAssetFromSystemAssetHub, - LocalReservableFromAssetHub as PenpalLocalReservableFromAssetHub, - LocalTeleportableToAssetHub as PenpalLocalTeleportableToAssetHub, - UsdtFromAssetHub as PenpalUsdtFromAssetHub, - }, - PenpalAParaPallet as PenpalAPallet, PenpalAssetOwner, - PenpalBParaPallet as PenpalBPallet, ED as PENPAL_ED, - }, - rococo_emulated_chain::{ - genesis::ED as ROCOCO_ED, - rococo_runtime::{ - governance as rococo_governance, - governance::pallet_custom_origins::Origin::Treasurer, - xcm_config::UniversalLocation as RococoUniversalLocation, Dmp, - OriginCaller as RococoOriginCaller, - }, - RococoRelayPallet as RococoPallet, - }, - AssetHubRococoPara as AssetHubRococo, AssetHubRococoParaReceiver as AssetHubRococoReceiver, - AssetHubRococoParaSender as AssetHubRococoSender, BridgeHubRococoPara as BridgeHubRococo, - BridgeHubRococoParaReceiver as BridgeHubRococoReceiver, PenpalAPara as PenpalA, - PenpalAParaReceiver as PenpalAReceiver, PenpalAParaSender as PenpalASender, - PenpalBPara as PenpalB, PenpalBParaReceiver as PenpalBReceiver, RococoRelay as Rococo, - RococoRelayReceiver as RococoReceiver, RococoRelaySender as RococoSender, - }; - - pub(crate) const ASSET_ID: u32 = 3; - pub(crate) const ASSET_MIN_BALANCE: u128 = 1000; - - pub(crate) type RelayToParaTest = Test; - pub(crate) type ParaToRelayTest = Test; - pub(crate) type SystemParaToRelayTest = Test; - pub(crate) type SystemParaToParaTest = Test; - pub(crate) type ParaToSystemParaTest = Test; - pub(crate) type ParaToParaThroughRelayTest = Test; - pub(crate) type ParaToParaThroughAHTest = Test; - pub(crate) type RelayToParaThroughAHTest = Test; -} - -#[cfg(test)] -mod tests; diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/claim_assets.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/claim_assets.rs deleted file mode 100644 index c4d9ef15e4614..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/claim_assets.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Tests related to claiming assets trapped during XCM execution. - -use crate::imports::*; - -use emulated_integration_tests_common::test_chain_can_claim_assets; - -#[test] -fn assets_can_be_claimed() { - let amount = AssetHubRococoExistentialDeposit::get(); - let assets: Assets = (Parent, amount).into(); - - test_chain_can_claim_assets!( - AssetHubRococo, - RuntimeCall, - NetworkId::ByGenesis(ROCOCO_GENESIS_HASH), - assets, - amount - ); -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/hybrid_transfers.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/hybrid_transfers.rs deleted file mode 100644 index a791c935da168..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/hybrid_transfers.rs +++ /dev/null @@ -1,824 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use super::reserve_transfer::*; -use crate::{ - imports::*, - tests::teleport::do_bidirectional_teleport_foreign_assets_between_para_and_asset_hub_using_xt, -}; - -fn para_to_para_assethub_hop_assertions(t: ParaToParaThroughAHTest) { - type RuntimeEvent = ::RuntimeEvent; - let sov_penpal_a_on_ah = AssetHubRococo::sovereign_account_id_of( - AssetHubRococo::sibling_location_of(PenpalA::para_id()), - ); - let sov_penpal_b_on_ah = AssetHubRococo::sovereign_account_id_of( - AssetHubRococo::sibling_location_of(PenpalB::para_id()), - ); - - assert_expected_events!( - AssetHubRococo, - vec![ - // Withdrawn from sender parachain SA - RuntimeEvent::Balances( - pallet_balances::Event::Burned { who, amount } - ) => { - who: *who == sov_penpal_a_on_ah, - amount: *amount == t.args.amount, - }, - // Deposited to receiver parachain SA - RuntimeEvent::Balances( - pallet_balances::Event::Minted { who, .. } - ) => { - who: *who == sov_penpal_b_on_ah, - }, - RuntimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); -} - -fn ah_to_para_transfer_assets(t: SystemParaToParaTest) -> DispatchResult { - let fee_idx = t.args.fee_asset_item as usize; - let fee: Asset = t.args.assets.inner().get(fee_idx).cloned().unwrap(); - let custom_xcm_on_dest = Xcm::<()>(vec![DepositAsset { - assets: Wild(AllCounted(t.args.assets.len() as u32)), - beneficiary: t.args.beneficiary, - }]); - ::PolkadotXcm::transfer_assets_using_type_and_then( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.assets.into()), - bx!(TransferType::LocalReserve), - bx!(fee.id.into()), - bx!(TransferType::LocalReserve), - bx!(VersionedXcm::from(custom_xcm_on_dest)), - t.args.weight_limit, - ) -} - -fn para_to_ah_transfer_assets(t: ParaToSystemParaTest) -> DispatchResult { - let fee_idx = t.args.fee_asset_item as usize; - let fee: Asset = t.args.assets.inner().get(fee_idx).cloned().unwrap(); - let custom_xcm_on_dest = Xcm::<()>(vec![DepositAsset { - assets: Wild(AllCounted(t.args.assets.len() as u32)), - beneficiary: t.args.beneficiary, - }]); - ::PolkadotXcm::transfer_assets_using_type_and_then( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.assets.into()), - bx!(TransferType::DestinationReserve), - bx!(fee.id.into()), - bx!(TransferType::DestinationReserve), - bx!(VersionedXcm::from(custom_xcm_on_dest)), - t.args.weight_limit, - ) -} - -fn para_to_para_transfer_assets_through_ah(t: ParaToParaThroughAHTest) -> DispatchResult { - let fee_idx = t.args.fee_asset_item as usize; - let fee: Asset = t.args.assets.inner().get(fee_idx).cloned().unwrap(); - let asset_hub_location: Location = PenpalA::sibling_location_of(AssetHubRococo::para_id()); - let custom_xcm_on_dest = Xcm::<()>(vec![DepositAsset { - assets: Wild(AllCounted(t.args.assets.len() as u32)), - beneficiary: t.args.beneficiary, - }]); - ::PolkadotXcm::transfer_assets_using_type_and_then( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.assets.into()), - bx!(TransferType::RemoteReserve(asset_hub_location.clone().into())), - bx!(fee.id.into()), - bx!(TransferType::RemoteReserve(asset_hub_location.into())), - bx!(VersionedXcm::from(custom_xcm_on_dest)), - t.args.weight_limit, - ) -} - -fn para_to_asset_hub_teleport_foreign_assets(t: ParaToSystemParaTest) -> DispatchResult { - let fee_idx = t.args.fee_asset_item as usize; - let fee: Asset = t.args.assets.inner().get(fee_idx).cloned().unwrap(); - let custom_xcm_on_dest = Xcm::<()>(vec![DepositAsset { - assets: Wild(AllCounted(t.args.assets.len() as u32)), - beneficiary: t.args.beneficiary, - }]); - ::PolkadotXcm::transfer_assets_using_type_and_then( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.assets.into()), - bx!(TransferType::Teleport), - bx!(fee.id.into()), - bx!(TransferType::DestinationReserve), - bx!(VersionedXcm::from(custom_xcm_on_dest)), - t.args.weight_limit, - ) -} - -fn asset_hub_to_para_teleport_foreign_assets(t: SystemParaToParaTest) -> DispatchResult { - let fee_idx = t.args.fee_asset_item as usize; - let fee: Asset = t.args.assets.inner().get(fee_idx).cloned().unwrap(); - let custom_xcm_on_dest = Xcm::<()>(vec![DepositAsset { - assets: Wild(AllCounted(t.args.assets.len() as u32)), - beneficiary: t.args.beneficiary, - }]); - ::PolkadotXcm::transfer_assets_using_type_and_then( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.assets.into()), - bx!(TransferType::Teleport), - bx!(fee.id.into()), - bx!(TransferType::LocalReserve), - bx!(VersionedXcm::from(custom_xcm_on_dest)), - t.args.weight_limit, - ) -} - -// =========================================================================== -// ======= Transfer - Native + Bridged Assets - AssetHub->Parachain ========== -// =========================================================================== -/// Transfers of native asset plus bridged asset from AssetHub to some Parachain -/// while paying fees using native asset. -#[test] -fn transfer_foreign_assets_from_asset_hub_to_para() { - let destination = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let sender = AssetHubRococoSender::get(); - let native_amount_to_send: Balance = ASSET_HUB_ROCOCO_ED * 10000; - let native_asset_location = RelayLocation::get(); - let receiver = PenpalAReceiver::get(); - let assets_owner = PenpalAssetOwner::get(); - // Foreign asset used: bridged WND - let foreign_amount_to_send = ASSET_HUB_ROCOCO_ED * 10_000_000; - let wnd_at_rococo_parachains = - Location::new(2, [Junction::GlobalConsensus(NetworkId::ByGenesis(WESTEND_GENESIS_HASH))]); - - // Configure destination chain to trust AH as reserve of WND - PenpalA::execute_with(|| { - assert_ok!(::System::set_storage( - ::RuntimeOrigin::root(), - vec![( - PenpalCustomizableAssetFromSystemAssetHub::key().to_vec(), - Location::new(2, [GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH))]).encode(), - )], - )); - }); - PenpalA::force_create_foreign_asset( - wnd_at_rococo_parachains.clone(), - assets_owner.clone(), - false, - ASSET_MIN_BALANCE, - vec![], - ); - AssetHubRococo::force_create_foreign_asset( - wnd_at_rococo_parachains.clone().try_into().unwrap(), - assets_owner.clone(), - false, - ASSET_MIN_BALANCE, - vec![], - ); - AssetHubRococo::mint_foreign_asset( - ::RuntimeOrigin::signed(assets_owner), - wnd_at_rococo_parachains.clone().try_into().unwrap(), - sender.clone(), - foreign_amount_to_send * 2, - ); - - // Assets to send - let assets: Vec = vec![ - (Parent, native_amount_to_send).into(), - (wnd_at_rococo_parachains.clone(), foreign_amount_to_send).into(), - ]; - let fee_asset_id = AssetId(Parent.into()); - let fee_asset_item = assets.iter().position(|a| a.id == fee_asset_id).unwrap() as u32; - - // Init Test - let test_args = TestContext { - sender: sender.clone(), - receiver: receiver.clone(), - args: TestArgs::new_para( - destination.clone(), - receiver.clone(), - native_amount_to_send, - assets.into(), - None, - fee_asset_item, - ), - }; - let mut test = SystemParaToParaTest::new(test_args); - - // Query initial balances - let sender_balance_before = test.sender.balance; - let sender_wnds_before = AssetHubRococo::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance( - wnd_at_rococo_parachains.clone().try_into().unwrap(), - &sender, - ) - }); - let receiver_assets_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(native_asset_location.clone(), &receiver) - }); - let receiver_wnds_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(wnd_at_rococo_parachains.clone(), &receiver) - }); - - // Set assertions and dispatchables - test.set_assertion::(system_para_to_para_sender_assertions); - test.set_assertion::(system_para_to_para_receiver_assertions); - test.set_dispatchable::(ah_to_para_transfer_assets); - test.assert(); - - // Query final balances - let sender_balance_after = test.sender.balance; - let sender_wnds_after = AssetHubRococo::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance( - wnd_at_rococo_parachains.clone().try_into().unwrap(), - &sender, - ) - }); - let receiver_assets_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(native_asset_location, &receiver) - }); - let receiver_wnds_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(wnd_at_rococo_parachains, &receiver) - }); - - // Sender's balance is reduced by amount sent plus delivery fees - assert!(sender_balance_after < sender_balance_before - native_amount_to_send); - // Sender's balance is reduced by foreign amount sent - assert_eq!(sender_wnds_after, sender_wnds_before - foreign_amount_to_send); - // Receiver's assets is increased - assert!(receiver_assets_after > receiver_assets_before); - // Receiver's assets increased by `amount_to_send - delivery_fees - bought_execution`; - // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but - // should be non-zero - assert!(receiver_assets_after < receiver_assets_before + native_amount_to_send); - // Receiver's balance is increased by foreign amount sent - assert_eq!(receiver_wnds_after, receiver_wnds_before + foreign_amount_to_send); -} - -/// Reserve Transfers of native asset from Parachain to System Parachain should work -// =========================================================================== -// ======= Transfer - Native + Bridged Assets - Parachain->AssetHub ========== -// =========================================================================== -/// Transfers of native asset plus bridged asset from some Parachain to AssetHub -/// while paying fees using native asset. -#[test] -fn transfer_foreign_assets_from_para_to_asset_hub() { - // Init values for Parachain - let destination = PenpalA::sibling_location_of(AssetHubRococo::para_id()); - let sender = PenpalASender::get(); - let native_amount_to_send: Balance = ASSET_HUB_ROCOCO_ED * 10000; - let native_asset_location = RelayLocation::get(); - let assets_owner = PenpalAssetOwner::get(); - - // Foreign asset used: bridged WND - let foreign_amount_to_send = ASSET_HUB_ROCOCO_ED * 10_000_000; - let wnd_at_rococo_parachains = - Location::new(2, [Junction::GlobalConsensus(NetworkId::ByGenesis(WESTEND_GENESIS_HASH))]); - - // Configure destination chain to trust AH as reserve of WND - PenpalA::execute_with(|| { - assert_ok!(::System::set_storage( - ::RuntimeOrigin::root(), - vec![( - PenpalCustomizableAssetFromSystemAssetHub::key().to_vec(), - Location::new(2, [GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH))]).encode(), - )], - )); - }); - PenpalA::force_create_foreign_asset( - wnd_at_rococo_parachains.clone(), - assets_owner.clone(), - false, - ASSET_MIN_BALANCE, - vec![], - ); - AssetHubRococo::force_create_foreign_asset( - wnd_at_rococo_parachains.clone().try_into().unwrap(), - assets_owner.clone(), - false, - ASSET_MIN_BALANCE, - vec![], - ); - - // fund Parachain's sender account - PenpalA::mint_foreign_asset( - ::RuntimeOrigin::signed(assets_owner.clone()), - native_asset_location.clone(), - sender.clone(), - native_amount_to_send * 2, - ); - PenpalA::mint_foreign_asset( - ::RuntimeOrigin::signed(assets_owner.clone()), - wnd_at_rococo_parachains.clone(), - sender.clone(), - foreign_amount_to_send * 2, - ); - - // Init values for System Parachain - let receiver = AssetHubRococoReceiver::get(); - let penpal_location_as_seen_by_ahr = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let sov_penpal_on_ahr = AssetHubRococo::sovereign_account_id_of(penpal_location_as_seen_by_ahr); - - // fund Parachain's SA on AssetHub with the assets held in reserve - AssetHubRococo::fund_accounts(vec![( - sov_penpal_on_ahr.clone().into(), - native_amount_to_send * 2, - )]); - AssetHubRococo::mint_foreign_asset( - ::RuntimeOrigin::signed(assets_owner), - wnd_at_rococo_parachains.clone().try_into().unwrap(), - sov_penpal_on_ahr, - foreign_amount_to_send * 2, - ); - - // Assets to send - let assets: Vec = vec![ - (Parent, native_amount_to_send).into(), - (wnd_at_rococo_parachains.clone(), foreign_amount_to_send).into(), - ]; - let fee_asset_id = AssetId(Parent.into()); - let fee_asset_item = assets.iter().position(|a| a.id == fee_asset_id).unwrap() as u32; - - // Init Test - let test_args = TestContext { - sender: sender.clone(), - receiver: receiver.clone(), - args: TestArgs::new_para( - destination.clone(), - receiver.clone(), - native_amount_to_send, - assets.into(), - None, - fee_asset_item, - ), - }; - let mut test = ParaToSystemParaTest::new(test_args); - - // Query initial balances - let sender_native_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(native_asset_location.clone(), &sender) - }); - let sender_wnds_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(wnd_at_rococo_parachains.clone(), &sender) - }); - let receiver_native_before = test.receiver.balance; - let receiver_wnds_before = AssetHubRococo::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance( - wnd_at_rococo_parachains.clone().try_into().unwrap(), - &receiver, - ) - }); - - // Set assertions and dispatchables - test.set_assertion::(para_to_system_para_sender_assertions); - test.set_assertion::(para_to_system_para_receiver_assertions); - test.set_dispatchable::(para_to_ah_transfer_assets); - test.assert(); - - // Query final balances - let sender_native_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(native_asset_location, &sender) - }); - let sender_wnds_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(wnd_at_rococo_parachains.clone(), &sender) - }); - let receiver_native_after = test.receiver.balance; - let receiver_wnds_after = AssetHubRococo::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance( - wnd_at_rococo_parachains.try_into().unwrap(), - &receiver, - ) - }); - - // Sender's balance is reduced by amount sent plus delivery fees - assert!(sender_native_after < sender_native_before - native_amount_to_send); - // Sender's balance is reduced by foreign amount sent - assert_eq!(sender_wnds_after, sender_wnds_before - foreign_amount_to_send); - // Receiver's balance is increased - assert!(receiver_native_after > receiver_native_before); - // Receiver's balance increased by `amount_to_send - delivery_fees - bought_execution`; - // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but - // should be non-zero - assert!(receiver_native_after < receiver_native_before + native_amount_to_send); - // Receiver's balance is increased by foreign amount sent - assert_eq!(receiver_wnds_after, receiver_wnds_before + foreign_amount_to_send); -} - -// ============================================================================== -// ===== Transfer - Native + Bridged Assets - Parachain->AssetHub->Parachain ==== -// ============================================================================== -/// Transfers of native asset plus bridged asset from Parachain to Parachain -/// (through AssetHub reserve) with fees paid using native asset. -#[test] -fn transfer_foreign_assets_from_para_to_para_through_asset_hub() { - // Init values for Parachain Origin - let destination = PenpalA::sibling_location_of(PenpalB::para_id()); - let sender = PenpalASender::get(); - let roc_to_send: Balance = ROCOCO_ED * 10000; - let assets_owner = PenpalAssetOwner::get(); - let roc_location = RelayLocation::get(); - let sender_as_seen_by_ah = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let sov_of_sender_on_ah = AssetHubRococo::sovereign_account_id_of(sender_as_seen_by_ah); - let receiver_as_seen_by_ah = AssetHubRococo::sibling_location_of(PenpalB::para_id()); - let sov_of_receiver_on_ah = AssetHubRococo::sovereign_account_id_of(receiver_as_seen_by_ah); - let wnd_to_send = ASSET_HUB_ROCOCO_ED * 10_000_000; - - // Configure source and destination chains to trust AH as reserve of WND - PenpalA::execute_with(|| { - assert_ok!(::System::set_storage( - ::RuntimeOrigin::root(), - vec![( - PenpalCustomizableAssetFromSystemAssetHub::key().to_vec(), - Location::new(2, [GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH))]).encode(), - )], - )); - }); - PenpalB::execute_with(|| { - assert_ok!(::System::set_storage( - ::RuntimeOrigin::root(), - vec![( - PenpalCustomizableAssetFromSystemAssetHub::key().to_vec(), - Location::new(2, [GlobalConsensus(ByGenesis(WESTEND_GENESIS_HASH))]).encode(), - )], - )); - }); - - // Register WND as foreign asset and transfer it around the Rococo ecosystem - let wnd_at_rococo_parachains = - Location::new(2, [Junction::GlobalConsensus(NetworkId::ByGenesis(WESTEND_GENESIS_HASH))]); - AssetHubRococo::force_create_foreign_asset( - wnd_at_rococo_parachains.clone().try_into().unwrap(), - assets_owner.clone(), - false, - ASSET_MIN_BALANCE, - vec![], - ); - PenpalA::force_create_foreign_asset( - wnd_at_rococo_parachains.clone(), - assets_owner.clone(), - false, - ASSET_MIN_BALANCE, - vec![], - ); - PenpalB::force_create_foreign_asset( - wnd_at_rococo_parachains.clone(), - assets_owner.clone(), - false, - ASSET_MIN_BALANCE, - vec![], - ); - - // fund Parachain's sender account - PenpalA::mint_foreign_asset( - ::RuntimeOrigin::signed(assets_owner.clone()), - roc_location.clone(), - sender.clone(), - roc_to_send * 2, - ); - PenpalA::mint_foreign_asset( - ::RuntimeOrigin::signed(assets_owner.clone()), - wnd_at_rococo_parachains.clone(), - sender.clone(), - wnd_to_send * 2, - ); - // fund the Parachain Origin's SA on Asset Hub with the assets held in reserve - AssetHubRococo::fund_accounts(vec![(sov_of_sender_on_ah.clone().into(), roc_to_send * 2)]); - AssetHubRococo::mint_foreign_asset( - ::RuntimeOrigin::signed(assets_owner), - wnd_at_rococo_parachains.clone().try_into().unwrap(), - sov_of_sender_on_ah.clone(), - wnd_to_send * 2, - ); - - // Init values for Parachain Destination - let receiver = PenpalBReceiver::get(); - - // Assets to send - let assets: Vec = vec![ - (roc_location.clone(), roc_to_send).into(), - (wnd_at_rococo_parachains.clone(), wnd_to_send).into(), - ]; - let fee_asset_id: AssetId = roc_location.clone().into(); - let fee_asset_item = assets.iter().position(|a| a.id == fee_asset_id).unwrap() as u32; - - // Init Test - let test_args = TestContext { - sender: sender.clone(), - receiver: receiver.clone(), - args: TestArgs::new_para( - destination, - receiver.clone(), - roc_to_send, - assets.into(), - None, - fee_asset_item, - ), - }; - let mut test = ParaToParaThroughAHTest::new(test_args); - - // Query initial balances - let sender_rocs_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(roc_location.clone(), &sender) - }); - let sender_wnds_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(wnd_at_rococo_parachains.clone(), &sender) - }); - let rocs_in_sender_reserve_on_ahr_before = - ::account_data_of(sov_of_sender_on_ah.clone()).free; - let wnds_in_sender_reserve_on_ahr_before = AssetHubRococo::execute_with(|| { - type Assets = ::ForeignAssets; - >::balance( - wnd_at_rococo_parachains.clone().try_into().unwrap(), - &sov_of_sender_on_ah, - ) - }); - let rocs_in_receiver_reserve_on_ahr_before = - ::account_data_of(sov_of_receiver_on_ah.clone()).free; - let wnds_in_receiver_reserve_on_ahr_before = AssetHubRococo::execute_with(|| { - type Assets = ::ForeignAssets; - >::balance( - wnd_at_rococo_parachains.clone().try_into().unwrap(), - &sov_of_receiver_on_ah, - ) - }); - let receiver_rocs_before = PenpalB::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(roc_location.clone(), &receiver) - }); - let receiver_wnds_before = PenpalB::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(wnd_at_rococo_parachains.clone(), &receiver) - }); - - // Set assertions and dispatchables - test.set_assertion::(para_to_para_through_hop_sender_assertions); - test.set_assertion::(para_to_para_assethub_hop_assertions); - test.set_assertion::(para_to_para_through_hop_receiver_assertions); - test.set_dispatchable::(para_to_para_transfer_assets_through_ah); - test.assert(); - - // Query final balances - let sender_rocs_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(roc_location.clone(), &sender) - }); - let sender_wnds_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(wnd_at_rococo_parachains.clone(), &sender) - }); - let wnds_in_sender_reserve_on_ahr_after = AssetHubRococo::execute_with(|| { - type Assets = ::ForeignAssets; - >::balance( - wnd_at_rococo_parachains.clone().try_into().unwrap(), - &sov_of_sender_on_ah, - ) - }); - let rocs_in_sender_reserve_on_ahr_after = - ::account_data_of(sov_of_sender_on_ah).free; - let wnds_in_receiver_reserve_on_ahr_after = AssetHubRococo::execute_with(|| { - type Assets = ::ForeignAssets; - >::balance( - wnd_at_rococo_parachains.clone().try_into().unwrap(), - &sov_of_receiver_on_ah, - ) - }); - let rocs_in_receiver_reserve_on_ahr_after = - ::account_data_of(sov_of_receiver_on_ah).free; - let receiver_rocs_after = PenpalB::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(roc_location, &receiver) - }); - let receiver_wnds_after = PenpalB::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(wnd_at_rococo_parachains, &receiver) - }); - - // Sender's balance is reduced by amount sent plus delivery fees - assert!(sender_rocs_after < sender_rocs_before - roc_to_send); - assert_eq!(sender_wnds_after, sender_wnds_before - wnd_to_send); - // Sovereign accounts on reserve are changed accordingly - assert_eq!( - rocs_in_sender_reserve_on_ahr_after, - rocs_in_sender_reserve_on_ahr_before - roc_to_send - ); - assert_eq!( - wnds_in_sender_reserve_on_ahr_after, - wnds_in_sender_reserve_on_ahr_before - wnd_to_send - ); - assert!(rocs_in_receiver_reserve_on_ahr_after > rocs_in_receiver_reserve_on_ahr_before); - assert_eq!( - wnds_in_receiver_reserve_on_ahr_after, - wnds_in_receiver_reserve_on_ahr_before + wnd_to_send - ); - // Receiver's balance is increased - assert!(receiver_rocs_after > receiver_rocs_before); - assert_eq!(receiver_wnds_after, receiver_wnds_before + wnd_to_send); -} - -// ============================================================================================== -// ==== Bidirectional Transfer - Native + Teleportable Foreign Assets - Parachain<->AssetHub ==== -// ============================================================================================== -/// Transfers of native asset plus teleportable foreign asset from Parachain to AssetHub and back -/// with fees paid using native asset. -#[test] -fn bidirectional_teleport_foreign_asset_between_para_and_asset_hub_using_explicit_transfer_types() { - do_bidirectional_teleport_foreign_assets_between_para_and_asset_hub_using_xt( - para_to_asset_hub_teleport_foreign_assets, - asset_hub_to_para_teleport_foreign_assets, - ); -} - -// =============================================================== -// ===== Transfer - Native Asset - Relay->AssetHub->Parachain ==== -// =============================================================== -/// Transfers of native asset Relay to Parachain (using AssetHub reserve). Parachains want to avoid -/// managing SAs on all system chains, thus want all their DOT-in-reserve to be held in their -/// Sovereign Account on Asset Hub. -#[test] -fn transfer_native_asset_from_relay_to_para_through_asset_hub() { - // Init values for Relay - let destination = Rococo::child_location_of(PenpalA::para_id()); - let sender = RococoSender::get(); - let amount_to_send: Balance = ROCOCO_ED * 1000; - - // Init values for Parachain - let relay_native_asset_location = RelayLocation::get(); - let receiver = PenpalAReceiver::get(); - - // Init Test - let test_args = TestContext { - sender, - receiver: receiver.clone(), - args: TestArgs::new_relay(destination.clone(), receiver.clone(), amount_to_send), - }; - let mut test = RelayToParaThroughAHTest::new(test_args); - - let sov_penpal_on_ah = AssetHubRococo::sovereign_account_id_of( - AssetHubRococo::sibling_location_of(PenpalA::para_id()), - ); - // Query initial balances - let sender_balance_before = test.sender.balance; - let sov_penpal_on_ah_before = AssetHubRococo::execute_with(|| { - ::Balances::free_balance(sov_penpal_on_ah.clone()) - }); - let receiver_assets_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(relay_native_asset_location.clone(), &receiver) - }); - - fn relay_assertions(t: RelayToParaThroughAHTest) { - type RuntimeEvent = ::RuntimeEvent; - Rococo::assert_xcm_pallet_attempted_complete(None); - assert_expected_events!( - Rococo, - vec![ - // Amount to teleport is withdrawn from Sender - RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => { - who: *who == t.sender.account_id, - amount: *amount == t.args.amount, - }, - // Amount to teleport is deposited in Relay's `CheckAccount` - RuntimeEvent::Balances(pallet_balances::Event::Minted { who, amount }) => { - who: *who == ::XcmPallet::check_account(), - amount: *amount == t.args.amount, - }, - ] - ); - } - fn asset_hub_assertions(_: RelayToParaThroughAHTest) { - type RuntimeEvent = ::RuntimeEvent; - let sov_penpal_on_ah = AssetHubRococo::sovereign_account_id_of( - AssetHubRococo::sibling_location_of(PenpalA::para_id()), - ); - assert_expected_events!( - AssetHubRococo, - vec![ - // Deposited to receiver parachain SA - RuntimeEvent::Balances( - pallet_balances::Event::Minted { who, .. } - ) => { - who: *who == sov_penpal_on_ah, - }, - RuntimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); - } - fn penpal_assertions(t: RelayToParaThroughAHTest) { - type RuntimeEvent = ::RuntimeEvent; - // Assets in t are relative to the relay chain. The asset here should be relative to - // Penpal, so parents: 1. - let expected_id: Location = Location { parents: 1, interior: Here }; - - assert_expected_events!( - PenpalA, - vec![ - RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { - asset_id: *asset_id == expected_id, - owner: *owner == t.receiver.account_id, - }, - ] - ); - } - fn transfer_assets_dispatchable(t: RelayToParaThroughAHTest) -> DispatchResult { - let fee_idx = t.args.fee_asset_item as usize; - let fee: Asset = t.args.assets.inner().get(fee_idx).cloned().unwrap(); - let asset_hub_location = Rococo::child_location_of(AssetHubRococo::para_id()); - let context = RococoUniversalLocation::get(); - - // reanchor fees to the view of destination (Penpal) - let mut remote_fees = fee.clone().reanchored(&t.args.dest, &context).unwrap(); - if let Fungible(ref mut amount) = remote_fees.fun { - // we already spent some fees along the way, just use half of what we started with - *amount = *amount / 2; - } - let xcm_on_final_dest = Xcm::<()>(vec![ - BuyExecution { fees: remote_fees, weight_limit: t.args.weight_limit.clone() }, - DepositAsset { - assets: Wild(AllCounted(t.args.assets.len() as u32)), - beneficiary: t.args.beneficiary, - }, - ]); - - // reanchor final dest (Penpal) to the view of hop (Asset Hub) - let mut dest = t.args.dest.clone(); - dest.reanchor(&asset_hub_location, &context).unwrap(); - // on Asset Hub, forward assets to Penpal - let xcm_on_hop = Xcm::<()>(vec![DepositReserveAsset { - assets: Wild(AllCounted(t.args.assets.len() as u32)), - dest, - xcm: xcm_on_final_dest, - }]); - - Dmp::make_parachain_reachable(AssetHubRococo::para_id()); - - // First leg is a teleport, from there a local-reserve-transfer to final dest - ::XcmPallet::transfer_assets_using_type_and_then( - t.signed_origin, - bx!(asset_hub_location.into()), - bx!(t.args.assets.into()), - bx!(TransferType::Teleport), - bx!(fee.id.into()), - bx!(TransferType::Teleport), - bx!(VersionedXcm::from(xcm_on_hop)), - t.args.weight_limit, - ) - } - - // Set assertions and dispatchables - test.set_assertion::(relay_assertions); - test.set_assertion::(asset_hub_assertions); - test.set_assertion::(penpal_assertions); - test.set_dispatchable::(transfer_assets_dispatchable); - test.assert(); - - // Query final balances - let sender_balance_after = test.sender.balance; - let sov_penpal_on_ah_after = AssetHubRococo::execute_with(|| { - ::Balances::free_balance(sov_penpal_on_ah) - }); - let receiver_assets_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(relay_native_asset_location, &receiver) - }); - - // Sender's balance is reduced by amount sent plus delivery fees - assert!(sender_balance_after < sender_balance_before - amount_to_send); - // SA on AH balance is increased - assert!(sov_penpal_on_ah_after > sov_penpal_on_ah_before); - // Receiver's asset balance is increased - assert!(receiver_assets_after > receiver_assets_before); - // Receiver's asset balance increased by `amount_to_send - delivery_fees - bought_execution`; - // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but - // should be non-zero - assert!(receiver_assets_after < receiver_assets_before + amount_to_send); -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/mod.rs deleted file mode 100644 index 0c425a7650716..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/mod.rs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -mod claim_assets; -mod hybrid_transfers; -mod reserve_transfer; -mod reward_pool; -mod send; -mod set_xcm_versions; -mod swap; -mod teleport; -mod treasury; -mod xcm_fee_estimation; - -#[macro_export] -macro_rules! create_pool_with_roc_on { - // default amounts - ( $chain:ident, $asset_id:expr, $is_foreign:expr, $asset_owner:expr ) => { - $crate::create_pool_with_roc_on!( - $chain, - $asset_id, - $is_foreign, - $asset_owner, - 1_000_000_000_000, - 2_000_000_000_000 - ); - }; - - // custom amounts - ( $chain:ident, $asset_id:expr, $is_foreign:expr, $asset_owner:expr, $roc_amount:expr, $asset_amount:expr ) => { - emulated_integration_tests_common::impls::paste::paste! { - <$chain>::execute_with(|| { - type RuntimeEvent = <$chain as Chain>::RuntimeEvent; - let owner = $asset_owner; - let signed_owner = <$chain as Chain>::RuntimeOrigin::signed(owner.clone()); - let roc_location: Location = Parent.into(); - if $is_foreign { - assert_ok!(<$chain as [<$chain Pallet>]>::ForeignAssets::mint( - signed_owner.clone(), - $asset_id.clone().into(), - owner.clone().into(), - 10_000_000_000_000, // For it to have more than enough. - )); - } else { - let asset_id = match $asset_id.interior.last() { - Some(GeneralIndex(id)) => *id as u32, - _ => unreachable!(), - }; - assert_ok!(<$chain as [<$chain Pallet>]>::Assets::mint( - signed_owner.clone(), - asset_id.into(), - owner.clone().into(), - 10_000_000_000_000, // For it to have more than enough. - )); - } - - assert_ok!(<$chain as [<$chain Pallet>]>::AssetConversion::create_pool( - signed_owner.clone(), - Box::new(roc_location.clone()), - Box::new($asset_id.clone()), - )); - - assert_expected_events!( - $chain, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::PoolCreated { .. }) => {}, - ] - ); - - assert_ok!(<$chain as [<$chain Pallet>]>::AssetConversion::add_liquidity( - signed_owner, - Box::new(roc_location), - Box::new($asset_id), - $roc_amount, - $asset_amount, - 0, - 0, - owner.into() - )); - - assert_expected_events!( - $chain, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::LiquidityAdded { .. }) => {}, - ] - ); - }); - } - }; -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/reserve_transfer.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/reserve_transfer.rs deleted file mode 100644 index d349fb459678a..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/reserve_transfer.rs +++ /dev/null @@ -1,1730 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::imports::*; -use sp_core::{crypto::get_public_from_string_or_panic, sr25519}; - -fn relay_to_para_sender_assertions(t: RelayToParaTest) { - type RuntimeEvent = ::RuntimeEvent; - - Rococo::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(350_000_000, 7000))); - - assert_expected_events!( - Rococo, - vec![ - // Amount to reserve transfer is transferred to Parachain's Sovereign account - RuntimeEvent::Balances( - pallet_balances::Event::Transfer { from, to, amount } - ) => { - from: *from == t.sender.account_id, - to: *to == Rococo::sovereign_account_id_of( - t.args.dest.clone() - ), - amount: *amount == t.args.amount, - }, - ] - ); -} - -fn para_to_relay_sender_assertions(t: ParaToRelayTest) { - type RuntimeEvent = ::RuntimeEvent; - PenpalA::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(2_000_000_000, 140_000))); - assert_expected_events!( - PenpalA, - vec![ - // Amount to reserve transfer is transferred to Parachain's Sovereign account - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Burned { asset_id, owner, balance, .. } - ) => { - asset_id: *asset_id == RelayLocation::get(), - owner: *owner == t.sender.account_id, - balance: *balance == t.args.amount, - }, - ] - ); -} - -pub fn system_para_to_para_sender_assertions(t: SystemParaToParaTest) { - type RuntimeEvent = ::RuntimeEvent; - AssetHubRococo::assert_xcm_pallet_attempted_complete(None); - - let sov_acc_of_dest = AssetHubRococo::sovereign_account_id_of(t.args.dest.clone()); - for asset in t.args.assets.into_inner().into_iter() { - let expected_id = asset.id.0.clone().try_into().unwrap(); - let asset_amount = if let Fungible(a) = asset.fun { Some(a) } else { None }.unwrap(); - if asset.id == AssetId(Location::new(1, [])) { - assert_expected_events!( - AssetHubRococo, - vec![ - // Amount of native asset is transferred to Parachain's Sovereign account - RuntimeEvent::Balances( - pallet_balances::Event::Transfer { from, to, amount } - ) => { - from: *from == t.sender.account_id, - to: *to == sov_acc_of_dest, - amount: *amount == asset_amount, - }, - ] - ); - } else if matches!( - asset.id.0.unpack(), - (0, [PalletInstance(ASSETS_PALLET_ID), GeneralIndex(_)]) - ) { - assert_expected_events!( - AssetHubRococo, - vec![ - // Amount of trust-backed asset is transferred to Parachain's Sovereign account - RuntimeEvent::Assets( - pallet_assets::Event::Transferred { from, to, amount, .. }, - ) => { - from: *from == t.sender.account_id, - to: *to == sov_acc_of_dest, - amount: *amount == asset_amount, - }, - ] - ); - } else { - assert_expected_events!( - AssetHubRococo, - vec![ - // Amount of foreign asset is transferred to Parachain's Sovereign account - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Transferred { asset_id, from, to, amount }, - ) => { - asset_id: *asset_id == expected_id, - from: *from == t.sender.account_id, - to: *to == sov_acc_of_dest, - amount: *amount == asset_amount, - }, - ] - ); - } - } - assert_expected_events!( - AssetHubRococo, - vec![ - // Delivery fees are paid - RuntimeEvent::PolkadotXcm(pallet_xcm::Event::FeesPaid { .. }) => {}, - ] - ); - AssetHubRococo::assert_xcm_pallet_sent(); -} - -pub fn system_para_to_para_receiver_assertions(t: SystemParaToParaTest) { - type RuntimeEvent = ::RuntimeEvent; - - PenpalA::assert_xcmp_queue_success(None); - for asset in t.args.assets.into_inner().into_iter() { - let expected_id = asset.id.0.try_into().unwrap(); - assert_expected_events!( - PenpalA, - vec![ - RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { - asset_id: *asset_id == expected_id, - owner: *owner == t.receiver.account_id, - }, - ] - ); - } -} - -pub fn system_para_to_penpal_receiver_assertions(t: SystemParaToParaTest) { - type RuntimeEvent = ::RuntimeEvent; - - PenpalA::assert_xcmp_queue_success(None); - for asset in t.args.assets.into_inner().into_iter() { - let mut expected_id: Location = asset.id.0.try_into().unwrap(); - let relative_id = match expected_id { - Location { parents: 1, interior: Here } => expected_id, - _ => { - expected_id - .push_front_interior(Parachain(AssetHubRococo::para_id().into())) - .unwrap(); - Location::new(1, expected_id.interior().clone()) - }, - }; - - assert_expected_events!( - PenpalA, - vec![ - RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { - asset_id: *asset_id == relative_id, - owner: *owner == t.receiver.account_id, - }, - ] - ); - } -} - -pub fn para_to_system_para_sender_assertions(t: ParaToSystemParaTest) { - type RuntimeEvent = ::RuntimeEvent; - PenpalA::assert_xcm_pallet_attempted_complete(None); - for asset in t.args.assets.into_inner().into_iter() { - let expected_id = asset.id.0; - let asset_amount = if let Fungible(a) = asset.fun { Some(a) } else { None }.unwrap(); - assert_expected_events!( - PenpalA, - vec![ - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Burned { asset_id, owner, balance } - ) => { - asset_id: *asset_id == expected_id, - owner: *owner == t.sender.account_id, - balance: *balance == asset_amount, - }, - ] - ); - } -} - -fn para_to_relay_receiver_assertions(t: ParaToRelayTest) { - type RuntimeEvent = ::RuntimeEvent; - let sov_penpal_on_relay = - Rococo::sovereign_account_id_of(Rococo::child_location_of(PenpalA::para_id())); - - Rococo::assert_ump_queue_processed( - true, - Some(PenpalA::para_id()), - Some(Weight::from_parts(306305000, 7_186)), - ); - - assert_expected_events!( - Rococo, - vec![ - // Amount to reserve transfer is withdrawn from Parachain's Sovereign account - RuntimeEvent::Balances( - pallet_balances::Event::Burned { who, amount } - ) => { - who: *who == sov_penpal_on_relay.clone().into(), - amount: *amount == t.args.amount, - }, - RuntimeEvent::Balances(pallet_balances::Event::Minted { .. }) => {}, - RuntimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); -} - -pub fn para_to_system_para_receiver_assertions(t: ParaToSystemParaTest) { - type RuntimeEvent = ::RuntimeEvent; - AssetHubRococo::assert_xcmp_queue_success(None); - - let sov_acc_of_penpal = AssetHubRococo::sovereign_account_id_of(Location::new( - 1, - Parachain(PenpalA::para_id().into()), - )); - - for (idx, asset) in t.args.assets.into_inner().into_iter().enumerate() { - let expected_id = asset.id.0.clone().try_into().unwrap(); - let asset_amount = if let Fungible(a) = asset.fun { Some(a) } else { None }.unwrap(); - if idx == t.args.fee_asset_item as usize { - assert_expected_events!( - AssetHubRococo, - vec![ - // Amount of native is withdrawn from Parachain's Sovereign account - RuntimeEvent::Balances( - pallet_balances::Event::Burned { who, amount } - ) => { - who: *who == sov_acc_of_penpal.clone().into(), - amount: *amount == asset_amount, - }, - RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { - who: *who == t.receiver.account_id, - }, - ] - ); - } else { - assert_expected_events!( - AssetHubRococo, - vec![ - // Amount of foreign asset is transferred from Parachain's Sovereign account - // to Receiver's account - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Burned { asset_id, owner, balance }, - ) => { - asset_id: *asset_id == expected_id, - owner: *owner == sov_acc_of_penpal, - balance: *balance == asset_amount, - }, - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Issued { asset_id, owner, amount }, - ) => { - asset_id: *asset_id == expected_id, - owner: *owner == t.receiver.account_id, - amount: *amount == asset_amount, - }, - ] - ); - } - } - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); -} - -fn system_para_to_para_assets_sender_assertions(t: SystemParaToParaTest) { - type RuntimeEvent = ::RuntimeEvent; - AssetHubRococo::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( - 864_610_000, - 8799, - ))); - - assert_expected_events!( - AssetHubRococo, - vec![ - // Amount to reserve transfer is transferred to Parachain's Sovereign account - RuntimeEvent::Assets( - pallet_assets::Event::Transferred { asset_id, from, to, amount } - ) => { - asset_id: *asset_id == RESERVABLE_ASSET_ID, - from: *from == t.sender.account_id, - to: *to == AssetHubRococo::sovereign_account_id_of( - t.args.dest.clone() - ), - amount: *amount == t.args.amount, - }, - // Native asset to pay for fees is transferred to Treasury - RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { - who: *who == TreasuryAccount::get(), - }, - // Delivery fees are paid - RuntimeEvent::PolkadotXcm( - pallet_xcm::Event::FeesPaid { .. } - ) => {}, - ] - ); -} - -fn para_to_system_para_assets_sender_assertions(t: ParaToSystemParaTest) { - type RuntimeEvent = ::RuntimeEvent; - let system_para_native_asset_location = RelayLocation::get(); - let reservable_asset_location = PenpalLocalReservableFromAssetHub::get(); - PenpalA::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts(2_000_000_000, 140000))); - assert_expected_events!( - PenpalA, - vec![ - // Fees amount to reserve transfer is burned from Parachains's sender account - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Burned { asset_id, owner, .. } - ) => { - asset_id: *asset_id == system_para_native_asset_location, - owner: *owner == t.sender.account_id, - }, - // Amount to reserve transfer is burned from Parachains's sender account - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Burned { asset_id, owner, balance } - ) => { - asset_id: *asset_id == reservable_asset_location, - owner: *owner == t.sender.account_id, - balance: *balance == t.args.amount, - }, - // Delivery fees are paid - RuntimeEvent::PolkadotXcm( - pallet_xcm::Event::FeesPaid { .. } - ) => {}, - ] - ); -} - -fn system_para_to_para_assets_receiver_assertions(t: SystemParaToParaTest) { - type RuntimeEvent = ::RuntimeEvent; - let system_para_asset_location = PenpalLocalReservableFromAssetHub::get(); - PenpalA::assert_xcmp_queue_success(None); - assert_expected_events!( - PenpalA, - vec![ - RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { - asset_id: *asset_id == RelayLocation::get(), - owner: *owner == t.receiver.account_id, - }, - RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, amount }) => { - asset_id: *asset_id == system_para_asset_location, - owner: *owner == t.receiver.account_id, - amount: *amount == t.args.amount, - }, - ] - ); -} - -fn para_to_system_para_assets_receiver_assertions(t: ParaToSystemParaTest) { - type RuntimeEvent = ::RuntimeEvent; - let sov_penpal_on_ahr = AssetHubRococo::sovereign_account_id_of( - AssetHubRococo::sibling_location_of(PenpalA::para_id()), - ); - AssetHubRococo::assert_xcmp_queue_success(None); - assert_expected_events!( - AssetHubRococo, - vec![ - // Amount to reserve transfer is burned from Parachain's Sovereign account - RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => { - asset_id: *asset_id == RESERVABLE_ASSET_ID, - owner: *owner == sov_penpal_on_ahr, - balance: *balance == t.args.amount, - }, - // Fee amount is burned from Parachain's Sovereign account - RuntimeEvent::Balances(pallet_balances::Event::Burned { who, .. }) => { - who: *who == sov_penpal_on_ahr, - }, - // Amount to reserve transfer is issued for beneficiary - RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, owner, amount }) => { - asset_id: *asset_id == RESERVABLE_ASSET_ID, - owner: *owner == t.receiver.account_id, - amount: *amount == t.args.amount, - }, - // Remaining fee amount is minted for for beneficiary - RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { - who: *who == t.receiver.account_id, - }, - ] - ); -} - -fn relay_to_para_assets_receiver_assertions(t: RelayToParaTest) { - type RuntimeEvent = ::RuntimeEvent; - - assert_expected_events!( - PenpalA, - vec![ - RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { - asset_id: *asset_id == RelayLocation::get(), - owner: *owner == t.receiver.account_id, - }, - RuntimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); -} - -pub fn para_to_para_through_hop_sender_assertions(t: Test) { - type RuntimeEvent = ::RuntimeEvent; - - PenpalA::assert_xcm_pallet_attempted_complete(None); - for asset in t.args.assets.into_inner() { - let expected_id = asset.id.0.clone().try_into().unwrap(); - let amount = if let Fungible(a) = asset.fun { Some(a) } else { None }.unwrap(); - assert_expected_events!( - PenpalA, - vec![ - // Amount to reserve transfer is transferred to Parachain's Sovereign account - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Burned { asset_id, owner, balance }, - ) => { - asset_id: *asset_id == expected_id, - owner: *owner == t.sender.account_id, - balance: *balance == amount, - }, - ] - ); - } -} - -fn para_to_para_asset_hub_hop_assertions(t: ParaToParaThroughAHTest) { - type RuntimeEvent = ::RuntimeEvent; - let sov_penpal_a_on_ah = AssetHubRococo::sovereign_account_id_of( - AssetHubRococo::sibling_location_of(PenpalA::para_id()), - ); - - let (_, asset_amount) = fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); - - assert_expected_events!( - AssetHubRococo, - vec![ - // Withdrawn from sender parachain SA - RuntimeEvent::Assets( - pallet_assets::Event::Burned { owner, balance, .. } - ) => { - owner: *owner == sov_penpal_a_on_ah, - balance: *balance == asset_amount, - }, - RuntimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); -} - -fn para_to_para_relay_hop_assertions(t: ParaToParaThroughRelayTest) { - type RuntimeEvent = ::RuntimeEvent; - let sov_penpal_a_on_rococo = - Rococo::sovereign_account_id_of(Rococo::child_location_of(PenpalA::para_id())); - let sov_penpal_b_on_rococo = - Rococo::sovereign_account_id_of(Rococo::child_location_of(PenpalB::para_id())); - - assert_expected_events!( - Rococo, - vec![ - // Withdrawn from sender parachain SA - RuntimeEvent::Balances( - pallet_balances::Event::Burned { who, amount } - ) => { - who: *who == sov_penpal_a_on_rococo, - amount: *amount == t.args.amount, - }, - // Deposited to receiver parachain SA - RuntimeEvent::Balances( - pallet_balances::Event::Minted { who, .. } - ) => { - who: *who == sov_penpal_b_on_rococo, - }, - RuntimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); -} - -pub fn para_to_para_through_hop_receiver_assertions(t: Test) { - type RuntimeEvent = ::RuntimeEvent; - - PenpalB::assert_xcmp_queue_success(None); - for asset in t.args.assets.into_inner().into_iter() { - let expected_id = asset.id.0.try_into().unwrap(); - assert_expected_events!( - PenpalB, - vec![ - RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { - asset_id: *asset_id == expected_id, - owner: *owner == t.receiver.account_id, - }, - ] - ); - } -} - -fn relay_to_para_reserve_transfer_assets(t: RelayToParaTest) -> DispatchResult { - let Junction::Parachain(para_id) = *t.args.dest.chain_location().last().unwrap() else { - unimplemented!("Destination is not a parachain?") - }; - - type Runtime = ::Runtime; - let remote_fee_id: AssetId = t - .args - .assets - .clone() - .into_inner() - .get(t.args.fee_asset_item as usize) - .ok_or(pallet_xcm::Error::::Empty)? - .clone() - .id; - - Dmp::make_parachain_reachable(para_id); - ::XcmPallet::transfer_assets_using_type_and_then( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.assets.into()), - bx!(TransferType::LocalReserve), - bx!(remote_fee_id.into()), - bx!(TransferType::LocalReserve), - bx!(VersionedXcm::from( - Xcm::<()>::builder_unsafe() - .deposit_asset(AllCounted(1), t.args.beneficiary) - .build() - )), - t.args.weight_limit, - ) -} - -fn para_to_relay_reserve_transfer_assets(t: ParaToRelayTest) -> DispatchResult { - type Runtime = ::Runtime; - let remote_fee_id: AssetId = t - .args - .assets - .clone() - .into_inner() - .get(t.args.fee_asset_item as usize) - .ok_or(pallet_xcm::Error::::Empty)? - .clone() - .id; - - ::PolkadotXcm::transfer_assets_using_type_and_then( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.assets.into()), - bx!(TransferType::DestinationReserve), - bx!(remote_fee_id.into()), - bx!(TransferType::DestinationReserve), - bx!(VersionedXcm::from( - Xcm::<()>::builder_unsafe() - .deposit_asset(AllCounted(1), t.args.beneficiary) - .build() - )), - t.args.weight_limit, - ) -} - -fn system_para_to_para_reserve_transfer_assets(t: SystemParaToParaTest) -> DispatchResult { - type Runtime = ::Runtime; - let remote_fee_id: AssetId = t - .args - .assets - .clone() - .into_inner() - .get(t.args.fee_asset_item as usize) - .ok_or(pallet_xcm::Error::::Empty)? - .clone() - .id; - - ::PolkadotXcm::transfer_assets_using_type_and_then( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.assets.into()), - bx!(TransferType::LocalReserve), - bx!(remote_fee_id.into()), - bx!(TransferType::LocalReserve), - bx!(VersionedXcm::from( - Xcm::<()>::builder_unsafe() - .deposit_asset(AllCounted(2), t.args.beneficiary) - .build() - )), - t.args.weight_limit, - ) -} - -fn para_to_para_through_asset_hub_limited_reserve_transfer_assets( - t: ParaToParaThroughAHTest, -) -> DispatchResult { - ::PolkadotXcm::limited_reserve_transfer_assets( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.beneficiary.into()), - bx!(t.args.assets.into()), - t.args.fee_asset_item, - t.args.weight_limit, - ) -} - -fn para_to_system_para_reserve_transfer_assets(t: ParaToSystemParaTest) -> DispatchResult { - type Runtime = ::Runtime; - let remote_fee_id: AssetId = t - .args - .assets - .clone() - .into_inner() - .get(t.args.fee_asset_item as usize) - .ok_or(pallet_xcm::Error::::Empty)? - .clone() - .id; - - ::PolkadotXcm::transfer_assets_using_type_and_then( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.assets.into()), - bx!(TransferType::DestinationReserve), - bx!(remote_fee_id.into()), - bx!(TransferType::DestinationReserve), - bx!(VersionedXcm::from( - Xcm::<()>::builder_unsafe() - .deposit_asset(AllCounted(2), t.args.beneficiary) - .build() - )), - t.args.weight_limit, - ) -} - -fn para_to_para_through_relay_limited_reserve_transfer_assets( - t: ParaToParaThroughRelayTest, -) -> DispatchResult { - let Junction::Parachain(para_id) = *t.args.dest.chain_location().last().unwrap() else { - unimplemented!("Destination is not a parachain?") - }; - - type Runtime = ::Runtime; - let remote_fee_id: AssetId = t - .args - .assets - .clone() - .into_inner() - .get(t.args.fee_asset_item as usize) - .ok_or(pallet_xcm::Error::::Empty)? - .clone() - .id; - - let relay_location = VersionedLocation::from(Location::parent()); - - Rococo::ext_wrapper(|| { - Dmp::make_parachain_reachable(para_id); - }); - ::PolkadotXcm::transfer_assets_using_type_and_then( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.assets.into()), - bx!(TransferType::RemoteReserve(relay_location.clone())), - bx!(remote_fee_id.into()), - bx!(TransferType::RemoteReserve(relay_location)), - bx!(VersionedXcm::from( - Xcm::<()>::builder_unsafe() - .deposit_asset(AllCounted(1), t.args.beneficiary) - .build() - )), - t.args.weight_limit, - ) -} - -/// Reserve Transfers of native asset from Relay Chain to the Asset Hub shouldn't work -#[test] -fn reserve_transfer_native_asset_from_relay_to_asset_hub_fails() { - // Init values for Relay Chain - let signed_origin = ::RuntimeOrigin::signed(RococoSender::get().into()); - let destination = Rococo::child_location_of(AssetHubRococo::para_id()); - let beneficiary: Location = - AccountId32Junction { network: None, id: AssetHubRococoReceiver::get().into() }.into(); - let amount_to_send: Balance = ROCOCO_ED * 1000; - let assets: Assets = (Here, amount_to_send).into(); - let fee_asset_item = 0; - - // this should fail - Rococo::execute_with(|| { - let result = ::XcmPallet::limited_reserve_transfer_assets( - signed_origin, - bx!(destination.into()), - bx!(beneficiary.into()), - bx!(assets.into()), - fee_asset_item, - WeightLimit::Unlimited, - ); - assert_err!( - result, - DispatchError::Module(sp_runtime::ModuleError { - index: 99, - error: [2, 0, 0, 0], - message: Some("Filtered") - }) - ); - }); -} - -/// Reserve Transfers of native asset from Asset Hub to Relay Chain shouldn't work -#[test] -fn reserve_transfer_native_asset_from_asset_hub_to_relay_fails() { - // Init values for Asset Hub - let signed_origin = - ::RuntimeOrigin::signed(AssetHubRococoSender::get().into()); - let destination = AssetHubRococo::parent_location(); - let beneficiary_id = RococoReceiver::get(); - let beneficiary: Location = - AccountId32Junction { network: None, id: beneficiary_id.into() }.into(); - let amount_to_send: Balance = ASSET_HUB_ROCOCO_ED * 1000; - - let assets: Assets = (Parent, amount_to_send).into(); - let fee_asset_item = 0; - - // this should fail - AssetHubRococo::execute_with(|| { - let result = - ::PolkadotXcm::limited_reserve_transfer_assets( - signed_origin, - bx!(destination.into()), - bx!(beneficiary.into()), - bx!(assets.into()), - fee_asset_item, - WeightLimit::Unlimited, - ); - assert_err!( - result, - DispatchError::Module(sp_runtime::ModuleError { - index: 31, - error: [2, 0, 0, 0], - message: Some("Filtered") - }) - ); - }); -} - -// ========================================================================= -// ========= Reserve Transfers - Native Asset - Relay<>Parachain =========== -// ========================================================================= -/// Reserve Transfers of native asset from Relay to Parachain should work -#[test] -fn reserve_transfer_native_asset_from_relay_to_para() { - // Init values for Relay - let destination = Rococo::child_location_of(PenpalA::para_id()); - let sender = RococoSender::get(); - let amount_to_send: Balance = ROCOCO_ED * 1000; - - // Init values for Parachain - let relay_native_asset_location = RelayLocation::get(); - let receiver = PenpalAReceiver::get(); - - // Init Test - let test_args = TestContext { - sender, - receiver: receiver.clone(), - args: TestArgs::new_relay(destination.clone(), receiver.clone(), amount_to_send), - }; - let mut test = RelayToParaTest::new(test_args); - - // Query initial balances - let sender_balance_before = test.sender.balance; - let receiver_assets_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(relay_native_asset_location.clone(), &receiver) - }); - - // Set assertions and dispatchables - test.set_assertion::(relay_to_para_sender_assertions); - test.set_assertion::(relay_to_para_assets_receiver_assertions); - test.set_dispatchable::(relay_to_para_reserve_transfer_assets); - test.assert(); - - // Query final balances - let sender_balance_after = test.sender.balance; - let receiver_assets_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(relay_native_asset_location, &receiver) - }); - - // Sender's balance is reduced by amount sent plus delivery fees - assert!(sender_balance_after < sender_balance_before - amount_to_send); - // Receiver's asset balance is increased - assert!(receiver_assets_after > receiver_assets_before); - // Receiver's asset balance increased by `amount_to_send - delivery_fees - bought_execution`; - // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but - // should be non-zero - assert!(receiver_assets_after < receiver_assets_before + amount_to_send); -} - -/// Reserve Transfers of native asset from Parachain to Relay should work -#[test] -fn reserve_transfer_native_asset_from_para_to_relay() { - // Init values for Parachain - let destination = PenpalA::parent_location(); - let sender = PenpalASender::get(); - let amount_to_send: Balance = ROCOCO_ED * 1000; - let assets: Assets = (Parent, amount_to_send).into(); - let asset_owner = PenpalAssetOwner::get(); - let relay_native_asset_location = RelayLocation::get(); - - // fund Parachain's sender account - PenpalA::mint_foreign_asset( - ::RuntimeOrigin::signed(asset_owner), - relay_native_asset_location.clone(), - sender.clone(), - amount_to_send * 2, - ); - - // Init values for Relay - let receiver = RococoReceiver::get(); - let penpal_location_as_seen_by_relay = Rococo::child_location_of(PenpalA::para_id()); - let sov_penpal_on_relay = Rococo::sovereign_account_id_of(penpal_location_as_seen_by_relay); - - // fund Parachain's SA on Relay with the native tokens held in reserve - Rococo::fund_accounts(vec![(sov_penpal_on_relay.into(), amount_to_send * 2)]); - - // Init Test - let test_args = TestContext { - sender: sender.clone(), - receiver: receiver.clone(), - args: TestArgs::new_para( - destination.clone(), - receiver, - amount_to_send, - assets.clone(), - None, - 0, - ), - }; - let mut test = ParaToRelayTest::new(test_args); - - // Query initial balances - let sender_assets_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(relay_native_asset_location.clone(), &sender) - }); - let receiver_balance_before = test.receiver.balance; - - // Set assertions and dispatchables - test.set_assertion::(para_to_relay_sender_assertions); - test.set_assertion::(para_to_relay_receiver_assertions); - test.set_dispatchable::(para_to_relay_reserve_transfer_assets); - test.assert(); - - // Query final balances - let sender_assets_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(relay_native_asset_location, &sender) - }); - let receiver_balance_after = test.receiver.balance; - - // Sender's balance is reduced by amount sent plus delivery fees - assert!(sender_assets_after < sender_assets_before - amount_to_send); - // Receiver's asset balance is increased - assert!(receiver_balance_after > receiver_balance_before); - // Receiver's asset balance increased by `amount_to_send - delivery_fees - bought_execution`; - // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but - // should be non-zero - assert!(receiver_balance_after < receiver_balance_before + amount_to_send); -} - -// ========================================================================= -// ======= Reserve Transfers - Native Asset - AssetHub<>Parachain ========== -// ========================================================================= -/// Reserve Transfers of native asset from Asset Hub to Parachain should work -#[test] -fn reserve_transfer_native_asset_from_asset_hub_to_para() { - // Init values for Asset Hub - let destination = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let sender = AssetHubRococoSender::get(); - let amount_to_send: Balance = ASSET_HUB_ROCOCO_ED * 10000; - let assets: Assets = (Parent, amount_to_send).into(); - - // Init values for Parachain - let system_para_native_asset_location = RelayLocation::get(); - let receiver = PenpalAReceiver::get(); - - // Init Test - let test_args = TestContext { - sender, - receiver: receiver.clone(), - args: TestArgs::new_para( - destination.clone(), - receiver.clone(), - amount_to_send, - assets.clone(), - None, - 0, - ), - }; - let mut test = SystemParaToParaTest::new(test_args); - - // Query initial balances - let sender_balance_before = test.sender.balance; - let receiver_assets_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(system_para_native_asset_location.clone(), &receiver) - }); - - // Set assertions and dispatchables - test.set_assertion::(system_para_to_para_sender_assertions); - test.set_assertion::(system_para_to_penpal_receiver_assertions); - test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); - test.assert(); - - // Query final balances - let sender_balance_after = test.sender.balance; - let receiver_assets_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(system_para_native_asset_location, &receiver) - }); - - // Sender's balance is reduced by amount sent plus delivery fees - assert!(sender_balance_after < sender_balance_before - amount_to_send); - // Receiver's assets is increased - assert!(receiver_assets_after > receiver_assets_before); - // Receiver's assets increased by `amount_to_send - delivery_fees - bought_execution`; - // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but - // should be non-zero - assert!(receiver_assets_after < receiver_assets_before + amount_to_send); -} - -/// Reserve Transfers of native asset from Parachain to Asset Hub should work -#[test] -fn reserve_transfer_native_asset_from_para_to_asset_hub() { - // Init values for Parachain - let destination = PenpalA::sibling_location_of(AssetHubRococo::para_id()); - let sender = PenpalASender::get(); - let amount_to_send: Balance = ASSET_HUB_ROCOCO_ED * 10000; - let assets: Assets = (Parent, amount_to_send).into(); - let system_para_native_asset_location = RelayLocation::get(); - let asset_owner = PenpalAssetOwner::get(); - - // fund Parachain's sender account - PenpalA::mint_foreign_asset( - ::RuntimeOrigin::signed(asset_owner), - system_para_native_asset_location.clone(), - sender.clone(), - amount_to_send * 2, - ); - - // Init values for Asset Hub - let receiver = AssetHubRococoReceiver::get(); - let penpal_location_as_seen_by_ahr = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let sov_penpal_on_ahr = AssetHubRococo::sovereign_account_id_of(penpal_location_as_seen_by_ahr); - - // fund Parachain's SA on Asset Hub with the native tokens held in reserve - AssetHubRococo::fund_accounts(vec![(sov_penpal_on_ahr.into(), amount_to_send * 2)]); - - // Init Test - let test_args = TestContext { - sender: sender.clone(), - receiver: receiver.clone(), - args: TestArgs::new_para( - destination.clone(), - receiver.clone(), - amount_to_send, - assets.clone(), - None, - 0, - ), - }; - let mut test = ParaToSystemParaTest::new(test_args); - - // Query initial balances - let sender_assets_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(system_para_native_asset_location.clone(), &sender) - }); - let receiver_balance_before = test.receiver.balance; - - // Set assertions and dispatchables - test.set_assertion::(para_to_system_para_sender_assertions); - test.set_assertion::(para_to_system_para_receiver_assertions); - test.set_dispatchable::(para_to_system_para_reserve_transfer_assets); - test.assert(); - - // Query final balances - let sender_assets_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(system_para_native_asset_location, &sender) - }); - let receiver_balance_after = test.receiver.balance; - - // Sender's balance is reduced by amount sent plus delivery fees - assert!(sender_assets_after < sender_assets_before - amount_to_send); - // Receiver's balance is increased - assert!(receiver_balance_after > receiver_balance_before); - // Receiver's balance increased by `amount_to_send - delivery_fees - bought_execution`; - // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but - // should be non-zero - assert!(receiver_balance_after < receiver_balance_before + amount_to_send); -} - -// ================================================================================== -// ======= Reserve Transfers - Native + Non-system Asset - AssetHub<>Parachain ====== -// ================================================================================== -/// Reserve Transfers of a local asset and native asset from Asset Hub to Parachain should -/// work -#[test] -fn reserve_transfer_multiple_assets_from_asset_hub_to_para() { - // Init values for Asset Hub - let destination = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let sov_penpal_on_ahr = AssetHubRococo::sovereign_account_id_of(destination.clone()); - let sender = AssetHubRococoSender::get(); - let fee_amount_to_send = ASSET_HUB_ROCOCO_ED * 10000; - let asset_amount_to_send = PENPAL_ED * 10000; - let asset_owner = AssetHubRococoAssetOwner::get(); - let asset_owner_signer = ::RuntimeOrigin::signed(asset_owner.clone()); - let assets: Assets = vec![ - (Parent, fee_amount_to_send).into(), - ( - [PalletInstance(ASSETS_PALLET_ID), GeneralIndex(RESERVABLE_ASSET_ID.into())], - asset_amount_to_send, - ) - .into(), - ] - .into(); - let fee_asset_index = assets - .inner() - .iter() - .position(|r| r == &(Parent, fee_amount_to_send).into()) - .unwrap() as u32; - AssetHubRococo::mint_asset( - asset_owner_signer, - RESERVABLE_ASSET_ID, - asset_owner, - asset_amount_to_send * 2, - ); - - // Create SA-of-Penpal-on-AHR with ED. - AssetHubRococo::fund_accounts(vec![(sov_penpal_on_ahr.into(), ASSET_HUB_ROCOCO_ED)]); - - // Init values for Parachain - let receiver = PenpalAReceiver::get(); - let system_para_native_asset_location = RelayLocation::get(); - let system_para_foreign_asset_location = PenpalLocalReservableFromAssetHub::get(); - - // Init Test - let para_test_args = TestContext { - sender: sender.clone(), - receiver: receiver.clone(), - args: TestArgs::new_para( - destination, - receiver.clone(), - asset_amount_to_send, - assets, - None, - fee_asset_index, - ), - }; - let mut test = SystemParaToParaTest::new(para_test_args); - - // Query initial balances - let sender_balance_before = test.sender.balance; - let sender_assets_before = AssetHubRococo::execute_with(|| { - type Assets = ::Assets; - >::balance(RESERVABLE_ASSET_ID, &sender) - }); - let receiver_system_native_assets_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(system_para_native_asset_location.clone(), &receiver) - }); - let receiver_foreign_assets_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance( - system_para_foreign_asset_location.clone(), - &receiver, - ) - }); - - // Set assertions and dispatchables - test.set_assertion::(system_para_to_para_assets_sender_assertions); - test.set_assertion::(system_para_to_para_assets_receiver_assertions); - test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); - test.assert(); - - // Query final balances - let sender_balance_after = test.sender.balance; - let sender_assets_after = AssetHubRococo::execute_with(|| { - type Assets = ::Assets; - >::balance(RESERVABLE_ASSET_ID, &sender) - }); - let receiver_system_native_assets_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(system_para_native_asset_location.clone(), &receiver) - }); - let receiver_foreign_assets_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(system_para_foreign_asset_location, &receiver) - }); - // Sender's balance is reduced - assert!(sender_balance_after < sender_balance_before); - // Receiver's foreign asset balance is increased - assert!(receiver_foreign_assets_after > receiver_foreign_assets_before); - // Receiver's system asset balance increased by `amount_to_send - delivery_fees - - // bought_execution`; `delivery_fees` might be paid from transfer or JIT, also - // `bought_execution` is unknown but should be non-zero - assert!( - receiver_system_native_assets_after < - receiver_system_native_assets_before + fee_amount_to_send - ); - - // Sender's asset balance is reduced by exact amount - assert_eq!(sender_assets_before - asset_amount_to_send, sender_assets_after); - // Receiver's foreign asset balance is increased by exact amount - assert_eq!( - receiver_foreign_assets_after, - receiver_foreign_assets_before + asset_amount_to_send - ); -} - -/// Reserve Transfers of a random asset and native asset from Parachain to Asset Hub should work -/// Receiver is empty account to show deposit works as long as transfer includes enough DOT for ED. -/// Once we have https://github.com/paritytech/polkadot-sdk/issues/5298, -/// we should do equivalent test with USDT instead of DOT. -#[test] -fn reserve_transfer_multiple_assets_from_para_to_asset_hub() { - // Init values for Parachain - let destination = PenpalA::sibling_location_of(AssetHubRococo::para_id()); - let sender = PenpalASender::get(); - let fee_amount_to_send = ASSET_HUB_ROCOCO_ED * 10000; - let asset_amount_to_send = ASSET_HUB_ROCOCO_ED * 10000; - let penpal_asset_owner = PenpalAssetOwner::get(); - let penpal_asset_owner_signer = ::RuntimeOrigin::signed(penpal_asset_owner); - let asset_location_on_penpal = PenpalLocalReservableFromAssetHub::get(); - let system_asset_location_on_penpal = RelayLocation::get(); - let assets: Assets = vec![ - (Parent, fee_amount_to_send).into(), - (asset_location_on_penpal.clone(), asset_amount_to_send).into(), - ] - .into(); - let fee_asset_index = assets - .inner() - .iter() - .position(|r| r == &(Parent, fee_amount_to_send).into()) - .unwrap() as u32; - // Fund Parachain's sender account with some foreign assets - PenpalA::mint_foreign_asset( - penpal_asset_owner_signer.clone(), - asset_location_on_penpal.clone(), - sender.clone(), - asset_amount_to_send * 2, - ); - // Fund Parachain's sender account with some system assets - PenpalA::mint_foreign_asset( - penpal_asset_owner_signer, - system_asset_location_on_penpal.clone(), - sender.clone(), - fee_amount_to_send * 2, - ); - - // Beneficiary is a new (empty) account - let receiver: sp_runtime::AccountId32 = - get_public_from_string_or_panic::(DUMMY_EMPTY).into(); - // Init values for Asset Hub - let penpal_location_as_seen_by_ahr = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let sov_penpal_on_ahr = AssetHubRococo::sovereign_account_id_of(penpal_location_as_seen_by_ahr); - let ah_asset_owner = AssetHubRococoAssetOwner::get(); - let ah_asset_owner_signer = ::RuntimeOrigin::signed(ah_asset_owner); - - // Fund SA-of-Penpal-on-AHR to be able to pay for the fees. - AssetHubRococo::fund_accounts(vec![( - sov_penpal_on_ahr.clone().into(), - ASSET_HUB_ROCOCO_ED * 10000000, - )]); - // Fund SA-of-Penpal-on-AHR to be able to pay for the sent amount. - AssetHubRococo::mint_asset( - ah_asset_owner_signer, - RESERVABLE_ASSET_ID, - sov_penpal_on_ahr, - asset_amount_to_send * 2, - ); - - // Init Test - let para_test_args = TestContext { - sender: sender.clone(), - receiver: receiver.clone(), - args: TestArgs::new_para( - destination, - receiver.clone(), - asset_amount_to_send, - assets, - None, - fee_asset_index, - ), - }; - let mut test = ParaToSystemParaTest::new(para_test_args); - - // Query initial balances - let sender_system_assets_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(system_asset_location_on_penpal.clone(), &sender) - }); - let sender_foreign_assets_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(asset_location_on_penpal.clone(), &sender) - }); - let receiver_balance_before = test.receiver.balance; - let receiver_assets_before = AssetHubRococo::execute_with(|| { - type Assets = ::Assets; - >::balance(RESERVABLE_ASSET_ID, &receiver) - }); - - // Set assertions and dispatchables - test.set_assertion::(para_to_system_para_assets_sender_assertions); - test.set_assertion::(para_to_system_para_assets_receiver_assertions); - test.set_dispatchable::(para_to_system_para_reserve_transfer_assets); - test.assert(); - - // Query final balances - let sender_system_assets_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(system_asset_location_on_penpal, &sender) - }); - let sender_foreign_assets_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(asset_location_on_penpal, &sender) - }); - let receiver_balance_after = test.receiver.balance; - let receiver_assets_after = AssetHubRococo::execute_with(|| { - type Assets = ::Assets; - >::balance(RESERVABLE_ASSET_ID, &receiver) - }); - // Sender's system asset balance is reduced - assert!(sender_system_assets_after < sender_system_assets_before); - // Receiver's balance is increased - assert!(receiver_balance_after > receiver_balance_before); - // Receiver's balance increased by `amount_to_send - delivery_fees - bought_execution`; - // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but - // should be non-zero - assert!(receiver_balance_after < receiver_balance_before + fee_amount_to_send); - - // Sender's asset balance is reduced by exact amount - assert_eq!(sender_foreign_assets_before - asset_amount_to_send, sender_foreign_assets_after); - // Receiver's foreign asset balance is increased by exact amount - assert_eq!(receiver_assets_after, receiver_assets_before + asset_amount_to_send); -} - -// ========================================================================= -// ===== Reserve Transfers - Native Asset - Parachain<>Relay<>Parachain ==== -// ========================================================================= -/// Reserve Transfers of native asset from Parachain to Parachain (through Relay reserve) should -/// work -#[test] -fn reserve_transfer_native_asset_from_para_to_para_through_relay() { - // Init values for Parachain Origin - let destination = PenpalA::sibling_location_of(PenpalB::para_id()); - let sender = PenpalASender::get(); - let amount_to_send: Balance = ROCOCO_ED * 10000; - let asset_owner = PenpalAssetOwner::get(); - let assets = (Parent, amount_to_send).into(); - let relay_native_asset_location = RelayLocation::get(); - let sender_as_seen_by_relay = Rococo::child_location_of(PenpalA::para_id()); - let sov_of_sender_on_relay = Rococo::sovereign_account_id_of(sender_as_seen_by_relay); - - // fund Parachain's sender account - PenpalA::mint_foreign_asset( - ::RuntimeOrigin::signed(asset_owner), - relay_native_asset_location.clone(), - sender.clone(), - amount_to_send * 2, - ); - - // fund the Parachain Origin's SA on Relay Chain with the native tokens held in reserve - Rococo::fund_accounts(vec![(sov_of_sender_on_relay.into(), amount_to_send * 2)]); - - // Init values for Parachain Destination - let receiver = PenpalBReceiver::get(); - - // Init Test - let test_args = TestContext { - sender: sender.clone(), - receiver: receiver.clone(), - args: TestArgs::new_para(destination, receiver.clone(), amount_to_send, assets, None, 0), - }; - let mut test = ParaToParaThroughRelayTest::new(test_args); - - // Query initial balances - let sender_assets_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(relay_native_asset_location.clone(), &sender) - }); - let receiver_assets_before = PenpalB::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(relay_native_asset_location.clone(), &receiver) - }); - - // Set assertions and dispatchables - test.set_assertion::(para_to_para_through_hop_sender_assertions); - test.set_assertion::(para_to_para_relay_hop_assertions); - test.set_assertion::(para_to_para_through_hop_receiver_assertions); - test.set_dispatchable::(para_to_para_through_relay_limited_reserve_transfer_assets); - test.assert(); - - // Query final balances - let sender_assets_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(relay_native_asset_location.clone(), &sender) - }); - let receiver_assets_after = PenpalB::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(relay_native_asset_location, &receiver) - }); - - // Sender's balance is reduced by amount sent plus delivery fees - assert!(sender_assets_after < sender_assets_before - amount_to_send); - // Receiver's balance is increased - assert!(receiver_assets_after > receiver_assets_before); -} - -// ============================================================================ -// ==== Reserve Transfers USDT - AssetHub->Parachain - pay fees using pool ==== -// ============================================================================ -#[test] -fn reserve_transfer_usdt_from_asset_hub_to_para() { - let usdt_id = 1984u32; - let penpal_location = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let penpal_sov_account = AssetHubRococo::sovereign_account_id_of(penpal_location.clone()); - - // Create SA-of-Penpal-on-AHW with ED. - // This ED isn't reflected in any derivative in a PenpalA account. - AssetHubRococo::fund_accounts(vec![(penpal_sov_account.clone().into(), ASSET_HUB_ROCOCO_ED)]); - - let sender = AssetHubRococoSender::get(); - let receiver = PenpalAReceiver::get(); - let asset_amount_to_send = 1_000_000_000_000; - - AssetHubRococo::execute_with(|| { - use frame_support::traits::tokens::fungibles::Mutate; - type Assets = ::Assets; - assert_ok!(>::mint_into( - usdt_id.into(), - &AssetHubRococoSender::get(), - asset_amount_to_send + 10_000_000_000_000, // Make sure it has enough. - )); - }); - - let relay_asset_penpal_pov = RelayLocation::get(); - - let usdt_from_asset_hub = PenpalUsdtFromAssetHub::get(); - - // Setup the pool between `relay_asset_penpal_pov` and `usdt_from_asset_hub` on PenpalA. - // So we can swap the custom asset that comes from AssetHubRococo for native asset to pay for - // fees. - PenpalA::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - - assert_ok!(::ForeignAssets::mint( - ::RuntimeOrigin::signed(PenpalAssetOwner::get()), - usdt_from_asset_hub.clone().into(), - PenpalASender::get().into(), - 10_000_000_000_000, // For it to have more than enough. - )); - - assert_ok!(::AssetConversion::create_pool( - ::RuntimeOrigin::signed(PenpalASender::get()), - Box::new(relay_asset_penpal_pov.clone()), - Box::new(usdt_from_asset_hub.clone()), - )); - - assert_expected_events!( - PenpalA, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::PoolCreated { .. }) => {}, - ] - ); - - assert_ok!(::AssetConversion::add_liquidity( - ::RuntimeOrigin::signed(PenpalASender::get()), - Box::new(relay_asset_penpal_pov), - Box::new(usdt_from_asset_hub.clone()), - // `usdt_from_asset_hub` is worth a third of `relay_asset_penpal_pov` - 1_000_000_000_000, - 3_000_000_000_000, - 0, - 0, - PenpalASender::get().into() - )); - - assert_expected_events!( - PenpalA, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::LiquidityAdded { .. }) => {}, - ] - ); - }); - - let assets: Assets = vec![( - [PalletInstance(ASSETS_PALLET_ID), GeneralIndex(usdt_id.into())], - asset_amount_to_send, - ) - .into()] - .into(); - - let test_args = TestContext { - sender: sender.clone(), - receiver: receiver.clone(), - args: TestArgs::new_para( - penpal_location, - receiver.clone(), - asset_amount_to_send, - assets, - None, - 0, - ), - }; - let mut test = SystemParaToParaTest::new(test_args); - - let sender_initial_balance = AssetHubRococo::execute_with(|| { - type Assets = ::Assets; - >::balance(usdt_id, &sender) - }); - let sender_initial_native_balance = AssetHubRococo::execute_with(|| { - type Balances = ::Balances; - Balances::free_balance(&sender) - }); - let receiver_initial_balance = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(usdt_from_asset_hub.clone(), &receiver) - }); - - test.set_assertion::(system_para_to_para_sender_assertions); - test.set_assertion::(system_para_to_penpal_receiver_assertions); - test.set_dispatchable::(system_para_to_para_reserve_transfer_assets); - test.assert(); - - let sender_after_balance = AssetHubRococo::execute_with(|| { - type Assets = ::Assets; - >::balance(usdt_id, &sender) - }); - let sender_after_native_balance = AssetHubRococo::execute_with(|| { - type Balances = ::Balances; - Balances::free_balance(&sender) - }); - let receiver_after_balance = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(usdt_from_asset_hub, &receiver) - }); - - // TODO(https://github.com/paritytech/polkadot-sdk/issues/5160): When we allow payment with different assets locally, this should be the same, since - // they aren't used for fees. - assert!(sender_after_native_balance < sender_initial_native_balance); - // Sender account's balance decreases. - assert_eq!(sender_after_balance, sender_initial_balance - asset_amount_to_send); - // Receiver account's balance increases. - assert!(receiver_after_balance > receiver_initial_balance); - assert!(receiver_after_balance < receiver_initial_balance + asset_amount_to_send); -} - -// =================================================================================== -// == Reserve Transfers USDT - Parachain->AssetHub->Parachain - pay fees using pool == -// =================================================================================== -// -// Transfer USDT From Penpal A to Penpal B with AssetHub as the reserve, while paying fees using -// USDT by making use of existing USDT pools on AssetHub and destination. -#[test] -fn reserve_transfer_usdt_from_para_to_para_through_asset_hub() { - let destination = PenpalA::sibling_location_of(PenpalB::para_id()); - let sender = PenpalASender::get(); - let asset_amount_to_send: Balance = ROCOCO_ED * 10000; - let fee_amount_to_send: Balance = ROCOCO_ED * 10000; - let sender_chain_as_seen_by_asset_hub = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let sov_of_sender_on_asset_hub = - AssetHubRococo::sovereign_account_id_of(sender_chain_as_seen_by_asset_hub); - let receiver_as_seen_by_asset_hub = AssetHubRococo::sibling_location_of(PenpalB::para_id()); - let sov_of_receiver_on_asset_hub = - AssetHubRococo::sovereign_account_id_of(receiver_as_seen_by_asset_hub); - - // Create SA-of-Penpal-on-AHW with ED. - // This ED isn't reflected in any derivative in a PenpalA account. - AssetHubRococo::fund_accounts(vec![ - (sov_of_sender_on_asset_hub.clone().into(), ASSET_HUB_ROCOCO_ED), - (sov_of_receiver_on_asset_hub.clone().into(), ASSET_HUB_ROCOCO_ED), - ]); - - // Give USDT to sov account of sender. - let usdt_id = 1984; - AssetHubRococo::execute_with(|| { - use frame_support::traits::tokens::fungibles::Mutate; - type Assets = ::Assets; - assert_ok!(>::mint_into( - usdt_id.into(), - &sov_of_sender_on_asset_hub.clone().into(), - asset_amount_to_send + fee_amount_to_send, - )); - }); - - // We create a pool between WND and USDT in AssetHub. - let native_asset: Location = Parent.into(); - let usdt = Location::new( - 0, - [Junction::PalletInstance(ASSETS_PALLET_ID), Junction::GeneralIndex(usdt_id.into())], - ); - - // set up pool with USDT <> native pair - AssetHubRococo::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - - assert_ok!(::Assets::mint( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - usdt_id.into(), - AssetHubRococoSender::get().into(), - 10_000_000_000_000, // For it to have more than enough. - )); - - assert_ok!(::AssetConversion::create_pool( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - Box::new(native_asset.clone()), - Box::new(usdt.clone()), - )); - - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::PoolCreated { .. }) => {}, - ] - ); - - assert_ok!(::AssetConversion::add_liquidity( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - Box::new(native_asset), - Box::new(usdt), - 1_000_000_000_000, - 2_000_000_000_000, // usdt is worth half of `native_asset` - 0, - 0, - AssetHubRococoSender::get().into() - )); - - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::LiquidityAdded { .. }) => {}, - ] - ); - }); - - let usdt_from_asset_hub = PenpalUsdtFromAssetHub::get(); - - // We also need a pool between WND and USDT on PenpalB. - PenpalB::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - let relay_asset = RelayLocation::get(); - - assert_ok!(::ForeignAssets::mint( - ::RuntimeOrigin::signed(PenpalAssetOwner::get()), - usdt_from_asset_hub.clone().into(), - PenpalBReceiver::get().into(), - 10_000_000_000_000, // For it to have more than enough. - )); - - assert_ok!(::AssetConversion::create_pool( - ::RuntimeOrigin::signed(PenpalBReceiver::get()), - Box::new(relay_asset.clone()), - Box::new(usdt_from_asset_hub.clone()), - )); - - assert_expected_events!( - PenpalB, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::PoolCreated { .. }) => {}, - ] - ); - - assert_ok!(::AssetConversion::add_liquidity( - ::RuntimeOrigin::signed(PenpalBReceiver::get()), - Box::new(relay_asset), - Box::new(usdt_from_asset_hub.clone()), - 1_000_000_000_000, - 2_000_000_000_000, // `usdt_from_asset_hub` is worth half of `relay_asset` - 0, - 0, - PenpalBReceiver::get().into() - )); - - assert_expected_events!( - PenpalB, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::LiquidityAdded { .. }) => {}, - ] - ); - }); - - PenpalA::execute_with(|| { - use frame_support::traits::tokens::fungibles::Mutate; - type ForeignAssets = ::ForeignAssets; - assert_ok!(>::mint_into( - usdt_from_asset_hub.clone(), - &sender, - asset_amount_to_send + fee_amount_to_send, - )); - }); - - // Prepare assets to transfer. - let assets: Assets = - (usdt_from_asset_hub.clone(), asset_amount_to_send + fee_amount_to_send).into(); - // Just to be very specific we're not including anything other than USDT. - assert_eq!(assets.len(), 1); - - // Give the sender enough Relay tokens to pay for local delivery fees. - // TODO(https://github.com/paritytech/polkadot-sdk/issues/5160): When we support local delivery fee payment in other assets, we don't need this. - PenpalA::mint_foreign_asset( - ::RuntimeOrigin::signed(PenpalAssetOwner::get()), - RelayLocation::get(), - sender.clone(), - 10_000_000_000_000, // Large estimate to make sure it works. - ); - - // Init values for Parachain Destination - let receiver = PenpalBReceiver::get(); - - // Init Test - let fee_asset_index = 0; - let test_args = TestContext { - sender: sender.clone(), - receiver: receiver.clone(), - args: TestArgs::new_para( - destination, - receiver.clone(), - asset_amount_to_send, - assets, - None, - fee_asset_index, - ), - }; - let mut test = ParaToParaThroughAHTest::new(test_args); - - // Query initial balances - let sender_assets_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(usdt_from_asset_hub.clone(), &sender) - }); - let receiver_assets_before = PenpalB::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(usdt_from_asset_hub.clone(), &receiver) - }); - test.set_assertion::(para_to_para_through_hop_sender_assertions); - test.set_assertion::(para_to_para_asset_hub_hop_assertions); - test.set_assertion::(para_to_para_through_hop_receiver_assertions); - test.set_dispatchable::( - para_to_para_through_asset_hub_limited_reserve_transfer_assets, - ); - test.assert(); - - // Query final balances - let sender_assets_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(usdt_from_asset_hub.clone(), &sender) - }); - let receiver_assets_after = PenpalB::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(usdt_from_asset_hub, &receiver) - }); - - // Sender's balance is reduced by amount - assert!(sender_assets_after < sender_assets_before - asset_amount_to_send); - // Receiver's balance is increased - assert!(receiver_assets_after > receiver_assets_before); -} - -/// Reserve Withdraw Native Asset from AssetHub to Parachain fails. -#[test] -fn reserve_withdraw_from_untrusted_reserve_fails() { - // Init values for Parachain Origin - let destination = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let signed_origin = - ::RuntimeOrigin::signed(AssetHubRococoSender::get().into()); - let roc_to_send: Balance = ROCOCO_ED * 10000; - let roc_location = RelayLocation::get(); - - // Assets to send - let assets: Vec = vec![(roc_location.clone(), roc_to_send).into()]; - let fee_id: AssetId = roc_location.into(); - - // this should fail - AssetHubRococo::execute_with(|| { - let result = ::PolkadotXcm::transfer_assets_using_type_and_then( - signed_origin.clone(), - bx!(destination.clone().into()), - bx!(assets.clone().into()), - bx!(TransferType::DestinationReserve), - bx!(fee_id.into()), - bx!(TransferType::DestinationReserve), - bx!(VersionedXcm::from(Xcm::<()>::new())), - Unlimited, - ); - assert_err!( - result, - DispatchError::Module(sp_runtime::ModuleError { - index: 31, - error: [22, 0, 0, 0], - message: Some("InvalidAssetUnsupportedReserve") - }) - ); - }); - - // this should also fail - AssetHubRococo::execute_with(|| { - let xcm: Xcm = Xcm(vec![ - WithdrawAsset(assets.into()), - InitiateReserveWithdraw { - assets: Wild(All), - reserve: destination, - xcm: Xcm::<()>::new(), - }, - ]); - let result = ::PolkadotXcm::execute( - signed_origin, - bx!(xcm::VersionedXcm::from(xcm)), - Weight::MAX, - ); - assert!(result.is_err()); - }); -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/reward_pool.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/reward_pool.rs deleted file mode 100644 index 5840ca28788c4..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/reward_pool.rs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::imports::*; -use frame_support::{sp_runtime::traits::Dispatchable, traits::schedule::DispatchTime}; -use xcm_executor::traits::ConvertLocation; - -#[test] -fn treasury_creates_asset_reward_pool() { - AssetHubRococo::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - type Balances = ::Balances; - - let treasurer = - Location::new(1, [Plurality { id: BodyId::Treasury, part: BodyPart::Voice }]); - let treasurer_account = - ahr_xcm_config::LocationToAccountId::convert_location(&treasurer).unwrap(); - - assert_ok!(Balances::force_set_balance( - ::RuntimeOrigin::root(), - treasurer_account.clone().into(), - ASSET_HUB_ROCOCO_ED * 100_000, - )); - - let events = AssetHubRococo::events(); - match events.iter().last() { - Some(RuntimeEvent::Balances(pallet_balances::Event::BalanceSet { who, .. })) => - assert_eq!(*who, treasurer_account), - _ => panic!("Expected Balances::BalanceSet event"), - } - }); - - Rococo::execute_with(|| { - type AssetHubRococoRuntimeCall = ::RuntimeCall; - type AssetHubRococoRuntime = ::Runtime; - type RococoRuntimeCall = ::RuntimeCall; - type RococoRuntime = ::Runtime; - type RococoRuntimeEvent = ::RuntimeEvent; - type RococoRuntimeOrigin = ::RuntimeOrigin; - - Dmp::make_parachain_reachable(AssetHubRococo::para_id()); - - let staked_asset_id = bx!(RelayLocation::get()); - let reward_asset_id = bx!(RelayLocation::get()); - - let reward_rate_per_block = 1_000_000_000; - let lifetime = 1_000_000_000; - let admin = None; - - let create_pool_call = - RococoRuntimeCall::XcmPallet(pallet_xcm::Call::::send { - dest: bx!(VersionedLocation::V4( - xcm::v4::Junction::Parachain(AssetHubRococo::para_id().into()).into() - )), - message: bx!(VersionedXcm::V5(Xcm(vec![ - UnpaidExecution { weight_limit: Unlimited, check_origin: None }, - Transact { - origin_kind: OriginKind::SovereignAccount, - fallback_max_weight: None, - call: AssetHubRococoRuntimeCall::AssetRewards( - pallet_asset_rewards::Call::::create_pool { - staked_asset_id, - reward_asset_id, - reward_rate_per_block, - expiry: DispatchTime::After(lifetime), - admin - } - ) - .encode() - .into(), - } - ]))), - }); - - let treasury_origin: RococoRuntimeOrigin = Treasurer.into(); - assert_ok!(create_pool_call.dispatch(treasury_origin)); - - assert_expected_events!( - Rococo, - vec![ - RococoRuntimeEvent::XcmPallet(pallet_xcm::Event::Sent { .. }) => {}, - ] - ); - }); - - AssetHubRococo::execute_with(|| { - type Runtime = ::Runtime; - type RuntimeEvent = ::RuntimeEvent; - - assert_eq!(1, pallet_asset_rewards::Pools::::iter().count()); - - let events = AssetHubRococo::events(); - match events.iter().last() { - Some(RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { - success: true, - .. - })) => (), - _ => panic!("Expected MessageQueue::Processed event"), - } - }); -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/send.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/send.rs deleted file mode 100644 index 663615b187ca4..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/send.rs +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::{create_pool_with_roc_on, imports::*}; - -/// Relay Chain should be able to execute `Transact` instructions in System Parachain -/// when `OriginKind::Superuser`. -#[test] -fn send_transact_as_superuser_from_relay_to_asset_hub_works() { - AssetHubRococo::force_create_asset_from_relay_as_root( - ASSET_ID, - ASSET_MIN_BALANCE, - true, - AssetHubRococoSender::get().into(), - Some(Weight::from_parts(144_933_000, 3675)), - ) -} - -/// We tests two things here: -/// - Parachain should be able to send XCM paying its fee at Asset Hub using system asset -/// - Parachain should be able to create a new Foreign Asset at Asset Hub -#[test] -fn send_xcm_from_para_to_asset_hub_paying_fee_with_system_asset() { - let para_sovereign_account = AssetHubRococo::sovereign_account_id_of( - AssetHubRococo::sibling_location_of(PenpalA::para_id()), - ); - let asset_location_on_penpal = Location::new( - 0, - [Junction::PalletInstance(ASSETS_PALLET_ID), Junction::GeneralIndex(ASSET_ID.into())], - ); - let foreign_asset_at_asset_hub = - Location::new(1, [Junction::Parachain(PenpalA::para_id().into())]) - .appended_with(asset_location_on_penpal) - .unwrap(); - - // Encoded `create_asset` call to be executed in AssetHub - let call = AssetHubRococo::create_foreign_asset_call( - foreign_asset_at_asset_hub.clone(), - ASSET_MIN_BALANCE, - para_sovereign_account.clone(), - ); - - let origin_kind = OriginKind::Xcm; - let fee_amount = ASSET_HUB_ROCOCO_ED * 1000000; - let system_asset = (Parent, fee_amount).into(); - - let root_origin = ::RuntimeOrigin::root(); - let system_para_destination = PenpalA::sibling_location_of(AssetHubRococo::para_id()).into(); - let xcm = xcm_transact_paid_execution( - call, - origin_kind, - system_asset, - para_sovereign_account.clone(), - ); - - // SA-of-Penpal-on-AHR needs to have balance to pay for fees and asset creation deposit - AssetHubRococo::fund_accounts(vec![( - para_sovereign_account.clone().into(), - ASSET_HUB_ROCOCO_ED * 10000000000, - )]); - - PenpalA::execute_with(|| { - assert_ok!(::PolkadotXcm::send( - root_origin, - bx!(system_para_destination), - bx!(xcm), - )); - - PenpalA::assert_xcm_pallet_sent(); - }); - - AssetHubRococo::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - AssetHubRococo::assert_xcmp_queue_success(None); - assert_expected_events!( - AssetHubRococo, - vec![ - // Burned the fee - RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => { - who: *who == para_sovereign_account, - amount: *amount == fee_amount, - }, - // Foreign Asset created - RuntimeEvent::ForeignAssets(pallet_assets::Event::Created { asset_id, creator, owner }) => { - asset_id: *asset_id == foreign_asset_at_asset_hub, - creator: *creator == para_sovereign_account.clone(), - owner: *owner == para_sovereign_account, - }, - ] - ); - - type ForeignAssets = ::ForeignAssets; - assert!(ForeignAssets::asset_exists(foreign_asset_at_asset_hub)); - }); -} - -/// We tests two things here: -/// - Parachain should be able to send XCM paying its fee at Asset Hub using sufficient asset -/// - Parachain should be able to create a new Asset at Asset Hub -#[test] -fn send_xcm_from_para_to_asset_hub_paying_fee_with_sufficient_asset() { - let para_sovereign_account = AssetHubRococo::sovereign_account_id_of( - AssetHubRococo::sibling_location_of(PenpalA::para_id()), - ); - - // Force create and mint sufficient assets for Parachain's sovereign account - AssetHubRococo::force_create_and_mint_asset( - ASSET_ID, - ASSET_MIN_BALANCE, - true, - para_sovereign_account.clone(), - Some(Weight::from_parts(144_933_000, 3675)), - ASSET_MIN_BALANCE * 1000000000, - ); - - // Just a different `asset_id`` that does not exist yet - let new_asset_id = ASSET_ID + 1; - - // Encoded `create_asset` call to be executed in AssetHub - let call = AssetHubRococo::create_asset_call( - new_asset_id, - ASSET_MIN_BALANCE, - para_sovereign_account.clone(), - ); - - let origin_kind = OriginKind::SovereignAccount; - let fee_amount = ASSET_MIN_BALANCE * 1000000; - let asset = - ([PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())], fee_amount).into(); - let asset_location = - Location::new(0, [PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())]); - - let root_origin = ::RuntimeOrigin::root(); - let system_para_destination = PenpalA::sibling_location_of(AssetHubRococo::para_id()).into(); - let xcm = xcm_transact_paid_execution(call, origin_kind, asset, para_sovereign_account.clone()); - - // SA-of-Penpal-on-AHR needs to have balance to pay for asset creation deposit - AssetHubRococo::fund_accounts(vec![( - para_sovereign_account.clone().into(), - ASSET_HUB_ROCOCO_ED * 10000000000, - )]); - - create_pool_with_roc_on!( - AssetHubRococo, - asset_location, - false, - para_sovereign_account.clone(), - 9_000_000_000_000_000, - 9_000_000_000_000 - ); - - PenpalA::execute_with(|| { - assert_ok!(::PolkadotXcm::send( - root_origin, - bx!(system_para_destination), - bx!(xcm), - )); - - PenpalA::assert_xcm_pallet_sent(); - }); - - AssetHubRococo::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - AssetHubRococo::assert_xcmp_queue_success(None); - assert_expected_events!( - AssetHubRococo, - vec![ - // Burned the fee - RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => { - asset_id: *asset_id == ASSET_ID, - owner: *owner == para_sovereign_account, - balance: *balance == fee_amount, - }, - // Asset created - RuntimeEvent::Assets(pallet_assets::Event::Created { asset_id, creator, owner }) => { - asset_id: *asset_id == new_asset_id, - creator: *creator == para_sovereign_account.clone(), - owner: *owner == para_sovereign_account, - }, - ] - ); - }); -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/set_xcm_versions.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/set_xcm_versions.rs deleted file mode 100644 index 8da1e56de219f..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/set_xcm_versions.rs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::imports::*; - -#[test] -fn relay_sets_system_para_xcm_supported_version() { - // Init tests variables - let sudo_origin = ::RuntimeOrigin::root(); - let system_para_destination: Location = Rococo::child_location_of(AssetHubRococo::para_id()); - - // Relay Chain sets supported version for Asset Parachain - Rococo::execute_with(|| { - assert_ok!(::XcmPallet::force_xcm_version( - sudo_origin, - bx!(system_para_destination.clone()), - XCM_V3 - )); - - type RuntimeEvent = ::RuntimeEvent; - - assert_expected_events!( - Rococo, - vec![ - RuntimeEvent::XcmPallet(pallet_xcm::Event::SupportedVersionChanged { - location, - version: XCM_V3 - }) => { location: *location == system_para_destination, }, - ] - ); - }); -} - -#[test] -fn system_para_sets_relay_xcm_supported_version() { - // Init test variables - let parent_location = AssetHubRococo::parent_location(); - let force_xcm_version_call = - ::RuntimeCall::PolkadotXcm(pallet_xcm::Call::< - ::Runtime, - >::force_xcm_version { - location: bx!(parent_location.clone()), - version: XCM_V3, - }) - .encode() - .into(); - - // System Parachain sets supported version for Relay Chain through it - Rococo::send_unpaid_transact_to_parachain_as_root( - AssetHubRococo::para_id(), - force_xcm_version_call, - ); - - // System Parachain receive the XCM message - AssetHubRococo::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - - AssetHubRococo::assert_dmp_queue_complete(Some(Weight::from_parts(115_294_000, 0))); - - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::PolkadotXcm(pallet_xcm::Event::SupportedVersionChanged { - location, - version: XCM_V3 - }) => { location: *location == parent_location, }, - ] - ); - }); -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/swap.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/swap.rs deleted file mode 100644 index 84506d8ec38dc..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/swap.rs +++ /dev/null @@ -1,395 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::imports::*; - -#[test] -fn swap_locally_on_chain_using_local_assets() { - let asset_native = Box::new(Location::try_from(RelayLocation::get()).unwrap()); - let asset_one = Box::new(Location::new( - 0, - [Junction::PalletInstance(ASSETS_PALLET_ID), Junction::GeneralIndex(ASSET_ID.into())], - )); - - AssetHubRococo::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - - assert_ok!(::Assets::create( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - ASSET_ID.into(), - AssetHubRococoSender::get().into(), - 1000, - )); - assert!(::Assets::asset_exists(ASSET_ID)); - - assert_ok!(::Assets::mint( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - ASSET_ID.into(), - AssetHubRococoSender::get().into(), - 100_000_000_000_000, - )); - - assert_ok!(::AssetConversion::create_pool( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - asset_native.clone(), - asset_one.clone(), - )); - - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::PoolCreated { .. }) => {}, - ] - ); - - assert_ok!(::AssetConversion::add_liquidity( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - asset_native.clone(), - asset_one.clone(), - 1_000_000_000_000, - 2_000_000_000_000, - 0, - 0, - AssetHubRococoSender::get().into() - )); - - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::LiquidityAdded {lp_token_minted, .. }) => { lp_token_minted: *lp_token_minted == 1414213562273, }, - ] - ); - - let path = vec![asset_native.clone(), asset_one.clone()]; - - assert_ok!( - ::AssetConversion::swap_exact_tokens_for_tokens( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - path, - 100, - 1, - AssetHubRococoSender::get().into(), - true - ) - ); - - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::SwapExecuted { amount_in, amount_out, .. }) => { - amount_in: *amount_in == 100, - amount_out: *amount_out == 199, - }, - ] - ); - - assert_ok!(::AssetConversion::remove_liquidity( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - asset_native, - asset_one, - 1414213562273 - ASSET_HUB_ROCOCO_ED * 2, // all but the 2 EDs can't be retrieved. - 0, - 0, - AssetHubRococoSender::get().into(), - )); - }); -} - -#[test] -fn swap_locally_on_chain_using_foreign_assets() { - let asset_native = Box::new(Location::try_from(RelayLocation::get()).unwrap()); - let asset_location_on_penpal = PenpalA::execute_with(|| { - Location::try_from(PenpalLocalTeleportableToAssetHub::get()).unwrap() - }); - let foreign_asset_at_asset_hub_rococo = - Location::new(1, [Junction::Parachain(PenpalA::para_id().into())]) - .appended_with(asset_location_on_penpal) - .unwrap(); - - let penpal_as_seen_by_ah = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let sov_penpal_on_ahr = AssetHubRococo::sovereign_account_id_of(penpal_as_seen_by_ah); - AssetHubRococo::fund_accounts(vec![ - // An account to swap dot for something else. - (AssetHubRococoSender::get().into(), 5_000_000 * ASSET_HUB_ROCOCO_ED), - // Penpal's sovereign account in AH should have some balance - (sov_penpal_on_ahr.clone().into(), 100_000_000 * ASSET_HUB_ROCOCO_ED), - ]); - - AssetHubRococo::execute_with(|| { - // 0: No need to create foreign asset as it exists in genesis. - // - // 1: Mint foreign asset on asset_hub_rococo: - // - // (While it might be nice to use batch, - // currently that's disabled due to safe call filters.) - - type RuntimeEvent = ::RuntimeEvent; - // 1. Mint foreign asset (in reality this should be a teleport or some such) - assert_ok!(::ForeignAssets::mint( - ::RuntimeOrigin::signed(sov_penpal_on_ahr.clone().into()), - foreign_asset_at_asset_hub_rococo.clone(), - sov_penpal_on_ahr.clone().into(), - ASSET_HUB_ROCOCO_ED * 3_000_000_000_000, - )); - - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { .. }) => {}, - ] - ); - - // 2. Create pool: - assert_ok!(::AssetConversion::create_pool( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - asset_native.clone(), - Box::new(foreign_asset_at_asset_hub_rococo.clone()), - )); - - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::PoolCreated { .. }) => {}, - ] - ); - - // 3. Add liquidity: - assert_ok!(::AssetConversion::add_liquidity( - ::RuntimeOrigin::signed(sov_penpal_on_ahr.clone()), - asset_native.clone(), - Box::new(foreign_asset_at_asset_hub_rococo.clone()), - 1_000_000_000_000, - 2_000_000_000_000, - 0, - 0, - sov_penpal_on_ahr.clone().into() - )); - - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::LiquidityAdded {lp_token_minted, .. }) => { - lp_token_minted: *lp_token_minted == 1414213562273, - }, - ] - ); - - // 4. Swap! - let path = vec![asset_native.clone(), Box::new(foreign_asset_at_asset_hub_rococo.clone())]; - - assert_ok!( - ::AssetConversion::swap_exact_tokens_for_tokens( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - path, - 100000 * ASSET_HUB_ROCOCO_ED, - 1000 * ASSET_HUB_ROCOCO_ED, - AssetHubRococoSender::get().into(), - true - ) - ); - - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::SwapExecuted { amount_in, amount_out, .. },) => { - amount_in: *amount_in == 333333300000, - amount_out: *amount_out == 498874118173, - }, - ] - ); - - // 5. Remove liquidity - assert_ok!(::AssetConversion::remove_liquidity( - ::RuntimeOrigin::signed(sov_penpal_on_ahr.clone()), - asset_native.clone(), - Box::new(foreign_asset_at_asset_hub_rococo.clone()), - 1414213562273 - ASSET_HUB_ROCOCO_ED * 2, // all but the 2 EDs can't be retrieved. - 0, - 0, - sov_penpal_on_ahr.clone().into(), - )); - }); -} - -#[test] -fn cannot_create_pool_from_pool_assets() { - let asset_native = RelayLocation::get(); - let mut asset_one = ahr_xcm_config::PoolAssetsPalletLocation::get(); - asset_one.append_with(GeneralIndex(ASSET_ID.into())).expect("pool assets"); - - AssetHubRococo::execute_with(|| { - let pool_owner_account_id = AssetHubRococoAssetConversionOrigin::get(); - - assert_ok!(::PoolAssets::create( - ::RuntimeOrigin::signed(pool_owner_account_id.clone()), - ASSET_ID.into(), - pool_owner_account_id.clone().into(), - 1000, - )); - assert!(::PoolAssets::asset_exists(ASSET_ID)); - - assert_ok!(::PoolAssets::mint( - ::RuntimeOrigin::signed(pool_owner_account_id), - ASSET_ID.into(), - AssetHubRococoSender::get().into(), - 3_000_000_000_000, - )); - - assert_matches::assert_matches!( - ::AssetConversion::create_pool( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - Box::new(Location::try_from(asset_native).unwrap()), - Box::new(Location::try_from(asset_one).unwrap()), - ), - Err(DispatchError::Module(ModuleError{index: _, error: _, message})) => assert_eq!(message, Some("Unknown")) - ); - }); -} - -#[test] -fn pay_xcm_fee_with_some_asset_swapped_for_native() { - let asset_native = Location::try_from(RelayLocation::get()).unwrap(); - let asset_one = Location { - parents: 0, - interior: [ - Junction::PalletInstance(ASSETS_PALLET_ID), - Junction::GeneralIndex(ASSET_ID.into()), - ] - .into(), - }; - let penpal = AssetHubRococo::sovereign_account_id_of(AssetHubRococo::sibling_location_of( - PenpalA::para_id(), - )); - - AssetHubRococo::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - - // set up pool with ASSET_ID <> NATIVE pair - assert_ok!(::Assets::create( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - ASSET_ID.into(), - AssetHubRococoSender::get().into(), - ASSET_MIN_BALANCE, - )); - assert!(::Assets::asset_exists(ASSET_ID)); - - assert_ok!(::Assets::mint( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - ASSET_ID.into(), - AssetHubRococoSender::get().into(), - 3_000_000_000_000, - )); - - assert_ok!(::AssetConversion::create_pool( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - Box::new(asset_native.clone()), - Box::new(asset_one.clone()), - )); - - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::PoolCreated { .. }) => {}, - ] - ); - - assert_ok!(::AssetConversion::add_liquidity( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - Box::new(asset_native), - Box::new(asset_one), - 1_000_000_000_000, - 2_000_000_000_000, - 0, - 0, - AssetHubRococoSender::get().into() - )); - - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::LiquidityAdded {lp_token_minted, .. }) => { lp_token_minted: *lp_token_minted == 1414213562273, }, - ] - ); - - // ensure `penpal` sovereign account has no native tokens and mint some `ASSET_ID` - assert_eq!( - ::Balances::free_balance(penpal.clone()), - 0 - ); - - assert_ok!(::Assets::touch_other( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - ASSET_ID.into(), - penpal.clone().into(), - )); - - assert_ok!(::Assets::mint( - ::RuntimeOrigin::signed(AssetHubRococoSender::get()), - ASSET_ID.into(), - penpal.clone().into(), - 10_000_000_000_000, - )); - }); - - PenpalA::execute_with(|| { - // send xcm transact from `penpal` account while paying with `ASSET_ID` tokens on - // `AssetHubRococo` - let call = ::RuntimeCall::System(frame_system::Call::< - ::Runtime, - >::remark { - remark: vec![], - }) - .encode() - .into(); - - let penpal_root = ::RuntimeOrigin::root(); - let fee_amount = 4_000_000_000_000u128; - let asset_one = - ([PalletInstance(ASSETS_PALLET_ID), GeneralIndex(ASSET_ID.into())], fee_amount).into(); - let asset_hub_location = PenpalA::sibling_location_of(AssetHubRococo::para_id()).into(); - let xcm = xcm_transact_paid_execution( - call, - OriginKind::SovereignAccount, - asset_one, - penpal.clone(), - ); - - assert_ok!(::PolkadotXcm::send( - penpal_root, - bx!(asset_hub_location), - bx!(xcm), - )); - - PenpalA::assert_xcm_pallet_sent(); - }); - - AssetHubRococo::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - - AssetHubRococo::assert_xcmp_queue_success(None); - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::AssetConversion(pallet_asset_conversion::Event::SwapCreditExecuted { .. },) => {}, - RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { success: true,.. }) => {}, - ] - ); - }); -} - -#[test] -fn xcm_fee_querying_apis_work() { - test_xcm_fee_querying_apis_work_for_asset_hub!(AssetHubRococo); -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/teleport.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/teleport.rs deleted file mode 100644 index 830a351f66097..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/teleport.rs +++ /dev/null @@ -1,653 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::imports::*; - -fn relay_dest_assertions_fail(_t: SystemParaToRelayTest) { - Rococo::assert_ump_queue_processed( - false, - Some(AssetHubRococo::para_id()), - Some(Weight::from_parts(157_718_000, 3_593)), - ); -} - -fn para_origin_assertions(t: SystemParaToRelayTest) { - type RuntimeEvent = ::RuntimeEvent; - - AssetHubRococo::assert_xcm_pallet_attempted_complete(Some(Weight::from_parts( - 730_053_000, - 4_000, - ))); - - AssetHubRococo::assert_parachain_system_ump_sent(); - - assert_expected_events!( - AssetHubRococo, - vec![ - // Amount is withdrawn from Sender's account - RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => { - who: *who == t.sender.account_id, - amount: *amount == t.args.amount, - }, - ] - ); -} - -fn penpal_to_ah_foreign_assets_sender_assertions(t: ParaToSystemParaTest) { - type RuntimeEvent = ::RuntimeEvent; - let system_para_native_asset_location = RelayLocation::get(); - let expected_asset_id = t.args.asset_id.unwrap(); - let (_, expected_asset_amount) = - non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); - - PenpalA::assert_xcm_pallet_attempted_complete(None); - assert_expected_events!( - PenpalA, - vec![ - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Burned { asset_id, owner, .. } - ) => { - asset_id: *asset_id == system_para_native_asset_location, - owner: *owner == t.sender.account_id, - }, - RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => { - asset_id: *asset_id == expected_asset_id, - owner: *owner == t.sender.account_id, - balance: *balance == expected_asset_amount, - }, - ] - ); -} - -fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) { - type RuntimeEvent = ::RuntimeEvent; - let sov_penpal_on_ahr = AssetHubRococo::sovereign_account_id_of( - AssetHubRococo::sibling_location_of(PenpalA::para_id()), - ); - let (_, expected_foreign_asset_amount) = - non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); - let (_, fee_asset_amount) = fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); - - AssetHubRococo::assert_xcmp_queue_success(None); - - assert_expected_events!( - AssetHubRococo, - vec![ - // native asset reserve transfer for paying fees, withdrawn from Penpal's sov account - RuntimeEvent::Balances( - pallet_balances::Event::Burned { who, amount } - ) => { - who: *who == sov_penpal_on_ahr.clone().into(), - amount: *amount == fee_asset_amount, - }, - RuntimeEvent::Balances(pallet_balances::Event::Minted { who, .. }) => { - who: *who == t.receiver.account_id, - }, - RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, amount }) => { - asset_id: *asset_id == PenpalATeleportableAssetLocation::get(), - owner: *owner == t.receiver.account_id, - amount: *amount == expected_foreign_asset_amount, - }, - RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {}, - ] - ); -} - -fn ah_to_penpal_foreign_assets_sender_assertions(t: SystemParaToParaTest) { - type RuntimeEvent = ::RuntimeEvent; - AssetHubRococo::assert_xcm_pallet_attempted_complete(None); - let (expected_foreign_asset_id, expected_foreign_asset_amount) = - non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); - let (_, fee_asset_amount) = fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); - assert_expected_events!( - AssetHubRococo, - vec![ - // native asset used for fees is transferred to Parachain's Sovereign account as reserve - RuntimeEvent::Balances( - pallet_balances::Event::Transfer { from, to, amount } - ) => { - from: *from == t.sender.account_id, - to: *to == AssetHubRococo::sovereign_account_id_of( - t.args.dest.clone() - ), - amount: *amount == fee_asset_amount, - }, - // foreign asset is burned locally as part of teleportation - RuntimeEvent::ForeignAssets(pallet_assets::Event::Burned { asset_id, owner, balance }) => { - asset_id: *asset_id == expected_foreign_asset_id, - owner: *owner == t.sender.account_id, - balance: *balance == expected_foreign_asset_amount, - }, - ] - ); -} - -fn ah_to_penpal_foreign_assets_receiver_assertions(t: SystemParaToParaTest) { - type RuntimeEvent = ::RuntimeEvent; - let expected_asset_id = t.args.asset_id.unwrap(); - let (_, expected_asset_amount) = - non_fee_asset(&t.args.assets, t.args.fee_asset_item as usize).unwrap(); - let checking_account = ::PolkadotXcm::check_account(); - let system_para_native_asset_location = RelayLocation::get(); - - PenpalA::assert_xcmp_queue_success(None); - - assert_expected_events!( - PenpalA, - vec![ - // checking account burns local asset as part of incoming teleport - RuntimeEvent::Assets(pallet_assets::Event::Burned { asset_id, owner, balance }) => { - asset_id: *asset_id == expected_asset_id, - owner: *owner == checking_account, - balance: *balance == expected_asset_amount, - }, - // local asset is teleported into account of receiver - RuntimeEvent::Assets(pallet_assets::Event::Issued { asset_id, owner, amount }) => { - asset_id: *asset_id == expected_asset_id, - owner: *owner == t.receiver.account_id, - amount: *amount == expected_asset_amount, - }, - // native asset for fee is deposited to receiver - RuntimeEvent::ForeignAssets(pallet_assets::Event::Issued { asset_id, owner, .. }) => { - asset_id: *asset_id == system_para_native_asset_location, - owner: *owner == t.receiver.account_id, - }, - ] - ); -} - -fn system_para_limited_teleport_assets(t: SystemParaToRelayTest) -> DispatchResult { - ::PolkadotXcm::limited_teleport_assets( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.beneficiary.into()), - bx!(t.args.assets.into()), - t.args.fee_asset_item, - t.args.weight_limit, - ) -} - -fn para_to_system_para_transfer_assets(t: ParaToSystemParaTest) -> DispatchResult { - type Runtime = ::Runtime; - let remote_fee_id: AssetId = t - .args - .assets - .clone() - .into_inner() - .get(t.args.fee_asset_item as usize) - .ok_or(pallet_xcm::Error::::Empty)? - .clone() - .id; - - ::PolkadotXcm::transfer_assets_using_type_and_then( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.assets.into()), - bx!(TransferType::Teleport), - bx!(remote_fee_id.into()), - bx!(TransferType::DestinationReserve), - bx!(VersionedXcm::from( - Xcm::<()>::builder_unsafe() - .deposit_asset(AllCounted(2), t.args.beneficiary) - .build() - )), - t.args.weight_limit, - ) -} - -fn system_para_to_para_transfer_assets(t: SystemParaToParaTest) -> DispatchResult { - type Runtime = ::Runtime; - let remote_fee_id: AssetId = t - .args - .assets - .clone() - .into_inner() - .get(t.args.fee_asset_item as usize) - .ok_or(pallet_xcm::Error::::Empty)? - .clone() - .id; - - ::PolkadotXcm::transfer_assets_using_type_and_then( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.assets.into()), - bx!(TransferType::Teleport), - bx!(remote_fee_id.into()), - bx!(TransferType::LocalReserve), - bx!(VersionedXcm::from( - Xcm::<()>::builder_unsafe() - .deposit_asset(AllCounted(2), t.args.beneficiary) - .build() - )), - t.args.weight_limit, - ) -} - -#[test] -fn teleport_via_limited_teleport_assets_to_other_system_parachains_works() { - let amount = ASSET_HUB_ROCOCO_ED * 100; - let native_asset: Assets = (Parent, amount).into(); - - test_parachain_is_trusted_teleporter!( - AssetHubRococo, // Origin - vec![BridgeHubRococo], // Destinations - (native_asset, amount), - limited_teleport_assets - ); -} - -#[test] -fn teleport_via_transfer_assets_to_other_system_parachains_works() { - let amount = ASSET_HUB_ROCOCO_ED * 100; - let native_asset: Assets = (Parent, amount).into(); - - test_parachain_is_trusted_teleporter!( - AssetHubRococo, // Origin - vec![BridgeHubRococo], // Destinations - (native_asset, amount), - transfer_assets - ); -} - -#[test] -fn teleport_via_limited_teleport_assets_from_and_to_relay() { - let amount = ROCOCO_ED * 100; - let native_asset: Assets = (Here, amount).into(); - - test_relay_is_trusted_teleporter!( - Rococo, - vec![AssetHubRococo], - (native_asset, amount), - limited_teleport_assets - ); - - test_parachain_is_trusted_teleporter_for_relay!( - AssetHubRococo, - Rococo, - amount, - limited_teleport_assets - ); -} - -#[test] -fn teleport_via_transfer_assets_from_and_to_relay() { - let amount = ROCOCO_ED * 100; - let native_asset: Assets = (Here, amount).into(); - - test_relay_is_trusted_teleporter!( - Rococo, - vec![AssetHubRococo], - (native_asset, amount), - transfer_assets - ); - - test_parachain_is_trusted_teleporter_for_relay!( - AssetHubRococo, - Rococo, - amount, - transfer_assets - ); -} - -/// Limited Teleport of native asset from System Parachain to Relay Chain -/// shouldn't work when there is not enough balance in Relay Chain's `CheckAccount` -#[test] -fn limited_teleport_native_assets_from_system_para_to_relay_fails() { - // Init values for Relay Chain - let amount_to_send: Balance = ASSET_HUB_ROCOCO_ED * 1000; - let destination = AssetHubRococo::parent_location().into(); - let beneficiary_id = RococoReceiver::get().into(); - let assets = (Parent, amount_to_send).into(); - - let test_args = TestContext { - sender: AssetHubRococoSender::get(), - receiver: RococoReceiver::get(), - args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), - }; - - let mut test = SystemParaToRelayTest::new(test_args); - - let sender_balance_before = test.sender.balance; - let receiver_balance_before = test.receiver.balance; - - test.set_assertion::(para_origin_assertions); - test.set_assertion::(relay_dest_assertions_fail); - test.set_dispatchable::(system_para_limited_teleport_assets); - test.assert(); - - let sender_balance_after = test.sender.balance; - let receiver_balance_after = test.receiver.balance; - - let delivery_fees = AssetHubRococo::execute_with(|| { - xcm_helpers::teleport_assets_delivery_fees::< - ::XcmSender, - >( - test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest - ) - }); - - // Sender's balance is reduced - assert_eq!(sender_balance_before - amount_to_send - delivery_fees, sender_balance_after); - // Receiver's balance does not change - assert_eq!(receiver_balance_after, receiver_balance_before); -} - -/// Bidirectional teleports of local Penpal assets to Asset Hub as foreign assets while paying -/// fees using (reserve transferred) native asset. -pub fn do_bidirectional_teleport_foreign_assets_between_para_and_asset_hub_using_xt( - para_to_ah_dispatchable: fn(ParaToSystemParaTest) -> DispatchResult, - ah_to_para_dispatchable: fn(SystemParaToParaTest) -> DispatchResult, -) { - // Init values for Parachain - let fee_amount_to_send: Balance = ASSET_HUB_ROCOCO_ED * 10000; - let asset_location_on_penpal = - PenpalA::execute_with(|| PenpalLocalTeleportableToAssetHub::get()); - let asset_id_on_penpal = match asset_location_on_penpal.last() { - Some(Junction::GeneralIndex(id)) => *id as u32, - _ => unreachable!(), - }; - let asset_amount_to_send = ASSET_HUB_ROCOCO_ED * 1000; - - let asset_owner = PenpalAssetOwner::get(); - let system_para_native_asset_location = RelayLocation::get(); - let sender = PenpalASender::get(); - let penpal_check_account = ::PolkadotXcm::check_account(); - let ah_as_seen_by_penpal = PenpalA::sibling_location_of(AssetHubRococo::para_id()); - let penpal_assets: Assets = vec![ - (Parent, fee_amount_to_send).into(), - (asset_location_on_penpal.clone(), asset_amount_to_send).into(), - ] - .into(); - let fee_asset_index = penpal_assets - .inner() - .iter() - .position(|r| r == &(Parent, fee_amount_to_send).into()) - .unwrap() as u32; - - // fund Parachain's sender account - PenpalA::mint_foreign_asset( - ::RuntimeOrigin::signed(asset_owner.clone()), - system_para_native_asset_location.clone(), - sender.clone(), - fee_amount_to_send * 2, - ); - // No need to create the asset (only mint) as it exists in genesis. - PenpalA::mint_asset( - ::RuntimeOrigin::signed(asset_owner.clone()), - asset_id_on_penpal, - sender.clone(), - asset_amount_to_send, - ); - // fund Parachain's check account to be able to teleport - PenpalA::fund_accounts(vec![(penpal_check_account.clone().into(), ASSET_HUB_ROCOCO_ED * 1000)]); - - // prefund SA of Penpal on AssetHub with enough native tokens to pay for fees - let penpal_as_seen_by_ah = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let sov_penpal_on_ah = AssetHubRococo::sovereign_account_id_of(penpal_as_seen_by_ah); - AssetHubRococo::fund_accounts(vec![( - sov_penpal_on_ah.clone().into(), - ASSET_HUB_ROCOCO_ED * 100_000_000_000, - )]); - - // Init values for System Parachain - let foreign_asset_at_asset_hub_rococo = - Location::new(1, [Junction::Parachain(PenpalA::para_id().into())]) - .appended_with(asset_location_on_penpal) - .unwrap(); - let penpal_to_ah_beneficiary_id = AssetHubRococoReceiver::get(); - - // Penpal to AH test args - let penpal_to_ah_test_args = TestContext { - sender: PenpalASender::get(), - receiver: AssetHubRococoReceiver::get(), - args: TestArgs::new_para( - ah_as_seen_by_penpal, - penpal_to_ah_beneficiary_id, - asset_amount_to_send, - penpal_assets, - Some(asset_id_on_penpal), - fee_asset_index, - ), - }; - let mut penpal_to_ah = ParaToSystemParaTest::new(penpal_to_ah_test_args); - let penpal_sender_balance_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance( - system_para_native_asset_location.clone(), - &PenpalASender::get(), - ) - }); - - let ah_receiver_balance_before = penpal_to_ah.receiver.balance; - - let penpal_sender_assets_before = PenpalA::execute_with(|| { - type Assets = ::Assets; - >::balance(asset_id_on_penpal, &PenpalASender::get()) - }); - let ah_receiver_assets_before = AssetHubRococo::execute_with(|| { - type Assets = ::ForeignAssets; - >::balance( - foreign_asset_at_asset_hub_rococo.clone().try_into().unwrap(), - &AssetHubRococoReceiver::get(), - ) - }); - - penpal_to_ah.set_assertion::(penpal_to_ah_foreign_assets_sender_assertions); - penpal_to_ah.set_assertion::(penpal_to_ah_foreign_assets_receiver_assertions); - penpal_to_ah.set_dispatchable::(para_to_ah_dispatchable); - penpal_to_ah.assert(); - - let penpal_sender_balance_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance( - system_para_native_asset_location.clone(), - &PenpalASender::get(), - ) - }); - - let ah_receiver_balance_after = penpal_to_ah.receiver.balance; - - let penpal_sender_assets_after = PenpalA::execute_with(|| { - type Assets = ::Assets; - >::balance(asset_id_on_penpal, &PenpalASender::get()) - }); - let ah_receiver_assets_after = AssetHubRococo::execute_with(|| { - type Assets = ::ForeignAssets; - >::balance( - foreign_asset_at_asset_hub_rococo.clone().try_into().unwrap(), - &AssetHubRococoReceiver::get(), - ) - }); - - // Sender's balance is reduced - assert!(penpal_sender_balance_after < penpal_sender_balance_before); - // Receiver's balance is increased - assert!(ah_receiver_balance_after > ah_receiver_balance_before); - // Receiver's balance increased by `amount_to_send - delivery_fees - bought_execution`; - // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but - // should be non-zero - assert!(ah_receiver_balance_after < ah_receiver_balance_before + fee_amount_to_send); - - // Sender's balance is reduced by exact amount - assert_eq!(penpal_sender_assets_before - asset_amount_to_send, penpal_sender_assets_after); - // Receiver's balance is increased by exact amount - assert_eq!(ah_receiver_assets_after, ah_receiver_assets_before + asset_amount_to_send); - - /////////////////////////////////////////////////////////////////////// - // Now test transferring foreign assets back from AssetHub to Penpal // - /////////////////////////////////////////////////////////////////////// - - // Move funds on AH from AHReceiver to AHSender - AssetHubRococo::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - assert_ok!(ForeignAssets::transfer( - ::RuntimeOrigin::signed(AssetHubRococoReceiver::get()), - foreign_asset_at_asset_hub_rococo.clone().try_into().unwrap(), - AssetHubRococoSender::get().into(), - asset_amount_to_send, - )); - }); - - let ah_to_penpal_beneficiary_id = PenpalAReceiver::get(); - let penpal_as_seen_by_ah = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let ah_assets: Assets = vec![ - (Parent, fee_amount_to_send).into(), - (foreign_asset_at_asset_hub_rococo.clone(), asset_amount_to_send).into(), - ] - .into(); - let fee_asset_index = ah_assets - .inner() - .iter() - .position(|r| r == &(Parent, fee_amount_to_send).into()) - .unwrap() as u32; - - // AH to Penpal test args - let ah_to_penpal_test_args = TestContext { - sender: AssetHubRococoSender::get(), - receiver: PenpalAReceiver::get(), - args: TestArgs::new_para( - penpal_as_seen_by_ah, - ah_to_penpal_beneficiary_id, - asset_amount_to_send, - ah_assets, - Some(asset_id_on_penpal), - fee_asset_index, - ), - }; - - let mut ah_to_penpal = SystemParaToParaTest::new(ah_to_penpal_test_args); - - let ah_sender_balance_before = ah_to_penpal.sender.balance; - let penpal_receiver_balance_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance( - system_para_native_asset_location.clone(), - &PenpalAReceiver::get(), - ) - }); - - let ah_sender_assets_before = AssetHubRococo::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance( - foreign_asset_at_asset_hub_rococo.clone().try_into().unwrap(), - &AssetHubRococoSender::get(), - ) - }); - let penpal_receiver_assets_before = PenpalA::execute_with(|| { - type Assets = ::Assets; - >::balance(asset_id_on_penpal, &PenpalAReceiver::get()) - }); - - ah_to_penpal.set_assertion::(ah_to_penpal_foreign_assets_sender_assertions); - ah_to_penpal.set_assertion::(ah_to_penpal_foreign_assets_receiver_assertions); - ah_to_penpal.set_dispatchable::(ah_to_para_dispatchable); - ah_to_penpal.assert(); - - let ah_sender_balance_after = ah_to_penpal.sender.balance; - let penpal_receiver_balance_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance( - system_para_native_asset_location, - &PenpalAReceiver::get(), - ) - }); - - let ah_sender_assets_after = AssetHubRococo::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance( - foreign_asset_at_asset_hub_rococo.try_into().unwrap(), - &AssetHubRococoSender::get(), - ) - }); - let penpal_receiver_assets_after = PenpalA::execute_with(|| { - type Assets = ::Assets; - >::balance(asset_id_on_penpal, &PenpalAReceiver::get()) - }); - - // Sender's balance is reduced - assert!(ah_sender_balance_after < ah_sender_balance_before); - // Receiver's balance is increased - assert!(penpal_receiver_balance_after > penpal_receiver_balance_before); - // Receiver's balance increased by `amount_to_send - delivery_fees - bought_execution`; - // `delivery_fees` might be paid from transfer or JIT, also `bought_execution` is unknown but - // should be non-zero - assert!(penpal_receiver_balance_after < penpal_receiver_balance_before + fee_amount_to_send); - - // Sender's balance is reduced by exact amount - assert_eq!(ah_sender_assets_before - asset_amount_to_send, ah_sender_assets_after); - // Receiver's balance is increased by exact amount - assert_eq!(penpal_receiver_assets_after, penpal_receiver_assets_before + asset_amount_to_send); -} - -/// Bidirectional teleports of local Penpal assets to Asset Hub as foreign assets should work -/// (using native reserve-based transfer for fees) -#[test] -fn bidirectional_teleport_foreign_assets_between_para_and_asset_hub() { - do_bidirectional_teleport_foreign_assets_between_para_and_asset_hub_using_xt( - para_to_system_para_transfer_assets, - system_para_to_para_transfer_assets, - ); -} - -/// Teleport Native Asset from AssetHub to Parachain fails. -#[test] -fn teleport_to_untrusted_chain_fails() { - // Init values for Parachain Origin - let destination = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let signed_origin = - ::RuntimeOrigin::signed(AssetHubRococoSender::get().into()); - let roc_to_send: Balance = ROCOCO_ED * 10000; - let roc_location = RelayLocation::get(); - - // Assets to send - let assets: Vec = vec![(roc_location.clone(), roc_to_send).into()]; - let fee_id: AssetId = roc_location.into(); - - // this should fail - AssetHubRococo::execute_with(|| { - let result = ::PolkadotXcm::transfer_assets_using_type_and_then( - signed_origin.clone(), - bx!(destination.clone().into()), - bx!(assets.clone().into()), - bx!(TransferType::Teleport), - bx!(fee_id.into()), - bx!(TransferType::Teleport), - bx!(VersionedXcm::from(Xcm::<()>::new())), - Unlimited, - ); - assert_err!( - result, - DispatchError::Module(sp_runtime::ModuleError { - index: 31, - error: [2, 0, 0, 0], - message: Some("Filtered") - }) - ); - }); - - // this should also fail - AssetHubRococo::execute_with(|| { - let xcm: Xcm = Xcm(vec![ - WithdrawAsset(assets.into()), - InitiateTeleport { assets: Wild(All), dest: destination, xcm: Xcm::<()>::new() }, - ]); - let result = ::PolkadotXcm::execute( - signed_origin, - bx!(xcm::VersionedXcm::from(xcm)), - Weight::MAX, - ); - assert!(result.is_err()); - }); -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/treasury.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/treasury.rs deleted file mode 100644 index d974b1b866ed0..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/treasury.rs +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::imports::*; -use emulated_integration_tests_common::{ - accounts::{ALICE, BOB}, - USDT_ID, -}; -use frame_support::{ - dispatch::RawOrigin, - sp_runtime::traits::Dispatchable, - traits::{ - fungible::Inspect, - fungibles::{Inspect as FungiblesInspect, Mutate}, - }, -}; -use parachains_common::AccountId; -use polkadot_runtime_common::impls::VersionedLocatableAsset; -use rococo_runtime_constants::currency::GRAND; -use xcm_executor::traits::ConvertLocation; - -// Fund Treasury account on Asset Hub from Treasury account on Relay Chain with ROCs. -#[test] -fn spend_roc_on_asset_hub() { - // initial treasury balance on Asset Hub in ROCs. - let treasury_balance = 9_000 * GRAND; - // the balance spend on Asset Hub. - let treasury_spend_balance = 1_000 * GRAND; - - let init_alice_balance = AssetHubRococo::execute_with(|| { - <::Balances as Inspect<_>>::balance( - &AssetHubRococo::account_id_of(ALICE), - ) - }); - - Rococo::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - type RuntimeCall = ::RuntimeCall; - type Runtime = ::Runtime; - type Balances = ::Balances; - type Treasury = ::Treasury; - - // Fund Treasury account on Asset Hub with ROCs. - - let root = ::RuntimeOrigin::root(); - let treasury_account = Treasury::account_id(); - - // Mint assets to Treasury account on Relay Chain. - assert_ok!(Balances::force_set_balance( - root.clone(), - treasury_account.clone().into(), - treasury_balance * 2, - )); - - Dmp::make_parachain_reachable(1000); - let native_asset = Location::here(); - let asset_hub_location: Location = [Parachain(1000)].into(); - let treasury_location: Location = (Parent, PalletInstance(18)).into(); - - let teleport_call = RuntimeCall::Utility(pallet_utility::Call::::dispatch_as { - as_origin: bx!(RococoOriginCaller::system(RawOrigin::Signed(treasury_account))), - call: bx!(RuntimeCall::XcmPallet(pallet_xcm::Call::::teleport_assets { - dest: bx!(VersionedLocation::from(asset_hub_location.clone())), - beneficiary: bx!(VersionedLocation::from(treasury_location)), - assets: bx!(VersionedAssets::from(Assets::from(Asset { - id: native_asset.clone().into(), - fun: treasury_balance.into() - }))), - fee_asset_item: 0, - })), - }); - - // Dispatched from Root to `dispatch_as` `Signed(treasury_account)`. - assert_ok!(teleport_call.dispatch(root)); - - assert_expected_events!( - Rococo, - vec![ - RuntimeEvent::XcmPallet(pallet_xcm::Event::Sent { .. }) => {}, - ] - ); - }); - - Rococo::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - type RuntimeCall = ::RuntimeCall; - type RuntimeOrigin = ::RuntimeOrigin; - type Runtime = ::Runtime; - type Treasury = ::Treasury; - - // Fund Alice account from Rococo Treasury account on Asset Hub. - - let treasury_origin: RuntimeOrigin = - rococo_governance::pallet_custom_origins::Origin::Treasurer.into(); - - let alice_location: Location = - [Junction::AccountId32 { network: None, id: Rococo::account_id_of(ALICE).into() }] - .into(); - let asset_hub_location: Location = [Parachain(1000)].into(); - let native_asset = Location::parent(); - - let treasury_spend_call = RuntimeCall::Treasury(pallet_treasury::Call::::spend { - asset_kind: bx!(VersionedLocatableAsset::from(( - asset_hub_location.clone(), - native_asset.into() - ))), - amount: treasury_spend_balance, - beneficiary: bx!(VersionedLocation::from(alice_location)), - valid_from: None, - }); - - assert_ok!(treasury_spend_call.dispatch(treasury_origin)); - - // Claim the spend. - - let bob_signed = RuntimeOrigin::signed(Rococo::account_id_of(BOB)); - assert_ok!(Treasury::payout(bob_signed.clone(), 0)); - - assert_expected_events!( - Rococo, - vec![ - RuntimeEvent::Treasury(pallet_treasury::Event::AssetSpendApproved { .. }) => {}, - RuntimeEvent::Treasury(pallet_treasury::Event::Paid { .. }) => {}, - ] - ); - }); - - AssetHubRococo::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - type Balances = ::Balances; - - // Ensure that the funds deposited to Alice account. - - let alice_account = AssetHubRococo::account_id_of(ALICE); - assert_eq!( - >::balance(&alice_account), - treasury_spend_balance + init_alice_balance - ); - - // Assert events triggered by xcm pay program: - // 1. treasury asset transferred to spend beneficiary; - // 2. response to Relay Chain Treasury pallet instance sent back; - // 3. XCM program completed; - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::Balances(pallet_balances::Event::Transfer { .. }) => {}, - RuntimeEvent::ParachainSystem(cumulus_pallet_parachain_system::Event::UpwardMessageSent { .. }) => {}, - RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { success: true ,.. }) => {}, - ] - ); - }); -} - -#[test] -fn create_and_claim_treasury_spend_in_usdt() { - const SPEND_AMOUNT: u128 = 10_000_000; - // treasury location from a sibling parachain. - let treasury_location: Location = Location::new(1, PalletInstance(18)); - // treasury account on a sibling parachain. - let treasury_account = - ahr_xcm_config::LocationToAccountId::convert_location(&treasury_location).unwrap(); - let asset_hub_location = Location::new(0, Parachain(AssetHubRococo::para_id().into())); - let root = ::RuntimeOrigin::root(); - // asset kind to be spent from the treasury. - let asset_kind: VersionedLocatableAsset = - (asset_hub_location, AssetId((PalletInstance(50), GeneralIndex(USDT_ID.into())).into())) - .into(); - // treasury spend beneficiary. - let alice: AccountId = Rococo::account_id_of(ALICE); - let bob: AccountId = Rococo::account_id_of(BOB); - let bob_signed = ::RuntimeOrigin::signed(bob.clone()); - - AssetHubRococo::execute_with(|| { - type Assets = ::Assets; - - // USDT created at genesis, mint some assets to the treasury account. - assert_ok!(>::mint_into(USDT_ID, &treasury_account, SPEND_AMOUNT * 4)); - // beneficiary has zero balance. - assert_eq!(>::balance(USDT_ID, &alice,), 0u128,); - }); - - Rococo::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - type Treasury = ::Treasury; - type AssetRate = ::AssetRate; - - // create a conversion rate from `asset_kind` to the native currency. - assert_ok!(AssetRate::create(root.clone(), Box::new(asset_kind.clone()), 2.into())); - - Dmp::make_parachain_reachable(1000); - - // create and approve a treasury spend. - assert_ok!(Treasury::spend( - root, - Box::new(asset_kind), - SPEND_AMOUNT, - Box::new(Location::new(0, Into::<[u8; 32]>::into(alice.clone())).into()), - None, - )); - // claim the spend. - assert_ok!(Treasury::payout(bob_signed.clone(), 0)); - - assert_expected_events!( - Rococo, - vec![ - RuntimeEvent::Treasury(pallet_treasury::Event::Paid { .. }) => {}, - ] - ); - }); - - AssetHubRococo::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - type Assets = ::Assets; - - // assert events triggered by xcm pay program - // 1. treasury asset transferred to spend beneficiary - // 2. response to Relay Chain treasury pallet instance sent back - // 3. XCM program completed - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::Assets(pallet_assets::Event::Transferred { asset_id: id, from, to, amount }) => { - id: id == &USDT_ID, - from: from == &treasury_account, - to: to == &alice, - amount: amount == &SPEND_AMOUNT, - }, - RuntimeEvent::ParachainSystem(cumulus_pallet_parachain_system::Event::UpwardMessageSent { .. }) => {}, - RuntimeEvent::MessageQueue(pallet_message_queue::Event::Processed { success: true ,.. }) => {}, - ] - ); - // beneficiary received the assets from the treasury. - assert_eq!(>::balance(USDT_ID, &alice,), SPEND_AMOUNT,); - }); - - Rococo::execute_with(|| { - type RuntimeEvent = ::RuntimeEvent; - type Treasury = ::Treasury; - - // check the payment status to ensure the response from the AssetHub was received. - assert_ok!(Treasury::check_status(bob_signed, 0)); - assert_expected_events!( - Rococo, - vec![ - RuntimeEvent::Treasury(pallet_treasury::Event::SpendProcessed { .. }) => {}, - ] - ); - }); -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/xcm_fee_estimation.rs b/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/xcm_fee_estimation.rs deleted file mode 100644 index 843d1b38c0395..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/xcm_fee_estimation.rs +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Tests for XCM fee estimation in the runtime. - -use crate::imports::*; -use emulated_integration_tests_common::test_can_estimate_and_pay_exact_fees; -use frame_support::dispatch::RawOrigin; -use xcm_runtime_apis::{ - dry_run::runtime_decl_for_dry_run_api::DryRunApiV2, - fees::runtime_decl_for_xcm_payment_api::XcmPaymentApiV2, -}; - -fn sender_assertions(test: ParaToParaThroughAHTest) { - type RuntimeEvent = ::RuntimeEvent; - PenpalA::assert_xcm_pallet_attempted_complete(None); - - assert_expected_events!( - PenpalA, - vec![ - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Burned { asset_id, owner, balance } - ) => { - asset_id: *asset_id == Location::new(1, []), - owner: *owner == test.sender.account_id, - balance: *balance == test.args.amount, - }, - ] - ); -} - -fn hop_assertions(test: ParaToParaThroughAHTest) { - type RuntimeEvent = ::RuntimeEvent; - AssetHubRococo::assert_xcmp_queue_success(None); - - assert_expected_events!( - AssetHubRococo, - vec![ - RuntimeEvent::Balances( - pallet_balances::Event::Burned { amount, .. } - ) => { - amount: *amount > test.args.amount * 90/100, - }, - ] - ); -} - -fn receiver_assertions(test: ParaToParaThroughAHTest) { - type RuntimeEvent = ::RuntimeEvent; - PenpalB::assert_xcmp_queue_success(None); - - assert_expected_events!( - PenpalB, - vec![ - RuntimeEvent::ForeignAssets( - pallet_assets::Event::Issued { asset_id, owner, .. } - ) => { - asset_id: *asset_id == Location::new(1, []), - owner: *owner == test.receiver.account_id, - }, - ] - ); -} - -fn transfer_assets_para_to_para_through_ah_call( - test: ParaToParaThroughAHTest, -) -> ::RuntimeCall { - type RuntimeCall = ::RuntimeCall; - - let asset_hub_location: Location = PenpalB::sibling_location_of(AssetHubRococo::para_id()); - let custom_xcm_on_dest = Xcm::<()>(vec![DepositAsset { - assets: Wild(AllCounted(test.args.assets.len() as u32)), - beneficiary: test.args.beneficiary, - }]); - RuntimeCall::PolkadotXcm(pallet_xcm::Call::transfer_assets_using_type_and_then { - dest: bx!(test.args.dest.into()), - assets: bx!(test.args.assets.clone().into()), - assets_transfer_type: bx!(TransferType::RemoteReserve(asset_hub_location.clone().into())), - remote_fees_id: bx!(VersionedAssetId::from(AssetId(Location::new(1, [])))), - fees_transfer_type: bx!(TransferType::RemoteReserve(asset_hub_location.into())), - custom_xcm_on_dest: bx!(VersionedXcm::from(custom_xcm_on_dest)), - weight_limit: test.args.weight_limit, - }) -} - -/// We are able to dry-run and estimate the fees for a multi-hop XCM journey. -/// Scenario: Alice on PenpalA has some DOTs and wants to send them to PenpalB. -/// We want to know the fees using the `DryRunApi` and `XcmPaymentApi`. -#[test] -fn multi_hop_works() { - let destination = PenpalA::sibling_location_of(PenpalB::para_id()); - let sender = PenpalASender::get(); - let amount_to_send = 1_000_000_000_000; - let asset_owner = PenpalAssetOwner::get(); - let assets: Assets = (Parent, amount_to_send).into(); - let relay_native_asset_location = Location::parent(); - let sender_as_seen_by_ah = AssetHubRococo::sibling_location_of(PenpalA::para_id()); - let sov_of_sender_on_ah = AssetHubRococo::sovereign_account_id_of(sender_as_seen_by_ah.clone()); - - // fund Parachain's sender account - PenpalA::mint_foreign_asset( - ::RuntimeOrigin::signed(asset_owner.clone()), - relay_native_asset_location.clone(), - sender.clone(), - amount_to_send * 2, - ); - - // fund the Parachain Origin's SA on AssetHub with the native tokens held in reserve. - AssetHubRococo::fund_accounts(vec![(sov_of_sender_on_ah.clone(), amount_to_send * 2)]); - - // Init values for Parachain Destination - let beneficiary_id = PenpalBReceiver::get(); - - let test_args = TestContext { - sender: PenpalASender::get(), // Bob in PenpalB. - receiver: PenpalBReceiver::get(), // Alice. - args: TestArgs::new_para( - destination, - beneficiary_id.clone(), - amount_to_send, - assets, - None, - 0, - ), - }; - let mut test = ParaToParaThroughAHTest::new(test_args); - - // We get them from the PenpalA closure. - let mut delivery_fees_amount = 0; - let mut remote_message = VersionedXcm::from(Xcm(Vec::new())); - ::execute_with(|| { - type Runtime = ::Runtime; - type OriginCaller = ::OriginCaller; - - let call = transfer_assets_para_to_para_through_ah_call(test.clone()); - let origin = OriginCaller::system(RawOrigin::Signed(sender.clone())); - let result = Runtime::dry_run_call(origin, call, xcm::prelude::XCM_VERSION).unwrap(); - // We filter the result to get only the messages we are interested in. - let (destination_to_query, messages_to_query) = &result - .forwarded_xcms - .iter() - .find(|(destination, _)| { - *destination == VersionedLocation::from(Location::new(1, [Parachain(1000)])) - }) - .unwrap(); - assert_eq!(messages_to_query.len(), 1); - remote_message = messages_to_query[0].clone(); - let asset_id_for_delivery_fees = VersionedAssetId::from(Location::parent()); - let delivery_fees = Runtime::query_delivery_fees( - destination_to_query.clone(), - remote_message.clone(), - asset_id_for_delivery_fees, - ) - .unwrap(); - delivery_fees_amount = get_amount_from_versioned_assets(delivery_fees); - }); - - // These are set in the AssetHub closure. - let mut intermediate_execution_fees = 0; - let mut intermediate_delivery_fees_amount = 0; - let mut intermediate_remote_message = VersionedXcm::from(Xcm::<()>(Vec::new())); - ::execute_with(|| { - type Runtime = ::Runtime; - type RuntimeCall = ::RuntimeCall; - - // First we get the execution fees. - let weight = Runtime::query_xcm_weight(remote_message.clone()).unwrap(); - intermediate_execution_fees = Runtime::query_weight_to_asset_fee( - weight, - VersionedAssetId::from(AssetId(Location::new(1, []))), - ) - .unwrap(); - - // We have to do this to turn `VersionedXcm<()>` into `VersionedXcm`. - let xcm_program = VersionedXcm::from(Xcm::::from( - remote_message.clone().try_into().unwrap(), - )); - - // Now we get the delivery fees to the final destination. - let result = - Runtime::dry_run_xcm(sender_as_seen_by_ah.clone().into(), xcm_program).unwrap(); - let (destination_to_query, messages_to_query) = &result - .forwarded_xcms - .iter() - .find(|(destination, _)| { - *destination == VersionedLocation::from(Location::new(1, [Parachain(2001)])) - }) - .unwrap(); - // There's actually two messages here. - // One created when the message we sent from PenpalA arrived and was executed. - // The second one when we dry-run the xcm. - // We could've gotten the message from the queue without having to dry-run, but - // offchain applications would have to dry-run, so we do it here as well. - intermediate_remote_message = messages_to_query[0].clone(); - let asset_id_for_delivery_fees = VersionedAssetId::from(Location::parent()); - let delivery_fees = Runtime::query_delivery_fees( - destination_to_query.clone(), - intermediate_remote_message.clone(), - asset_id_for_delivery_fees, - ) - .unwrap(); - intermediate_delivery_fees_amount = get_amount_from_versioned_assets(delivery_fees); - }); - - // Get the final execution fees in the destination. - let mut final_execution_fees = 0; - ::execute_with(|| { - type Runtime = ::Runtime; - - let weight = Runtime::query_xcm_weight(intermediate_remote_message.clone()).unwrap(); - final_execution_fees = Runtime::query_weight_to_asset_fee( - weight, - VersionedAssetId::from(AssetId(Location::parent())), - ) - .unwrap(); - }); - - // Dry-running is done. - PenpalA::reset_ext(); - AssetHubRococo::reset_ext(); - PenpalB::reset_ext(); - - // Fund accounts again. - PenpalA::mint_foreign_asset( - ::RuntimeOrigin::signed(asset_owner), - relay_native_asset_location.clone(), - sender.clone(), - amount_to_send * 2, - ); - AssetHubRococo::fund_accounts(vec![(sov_of_sender_on_ah, amount_to_send * 2)]); - - // Actually run the extrinsic. - let sender_assets_before = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(relay_native_asset_location.clone(), &sender) - }); - let receiver_assets_before = PenpalB::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(relay_native_asset_location.clone(), &beneficiary_id) - }); - - test.set_assertion::(sender_assertions); - test.set_assertion::(hop_assertions); - test.set_assertion::(receiver_assertions); - let call = transfer_assets_para_to_para_through_ah_call(test.clone()); - test.set_call(call); - test.assert(); - - let sender_assets_after = PenpalA::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(relay_native_asset_location.clone(), &sender) - }); - let receiver_assets_after = PenpalB::execute_with(|| { - type ForeignAssets = ::ForeignAssets; - >::balance(relay_native_asset_location, &beneficiary_id) - }); - - // We know the exact fees on every hop. - assert_eq!( - sender_assets_after, - sender_assets_before - amount_to_send - delivery_fees_amount /* This is charged directly - * from the sender's - * account. */ - ); - assert_eq!( - receiver_assets_after, - receiver_assets_before + amount_to_send - - intermediate_execution_fees - - intermediate_delivery_fees_amount - - final_execution_fees - ); -} - -#[test] -fn multi_hop_pay_fees_works() { - test_can_estimate_and_pay_exact_fees!( - PenpalA, - AssetHubRococo, - PenpalB, - (Parent, 1_000_000_000_000u128), - Penpal - ); -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/Cargo.toml b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/Cargo.toml index c44e9c5c91791..846cc340fe15c 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/Cargo.toml +++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/Cargo.toml @@ -39,7 +39,6 @@ asset-hub-rococo-runtime = { workspace = true } cumulus-pallet-xcmp-queue = { workspace = true } emulated-integration-tests-common = { workspace = true } parachains-common = { workspace = true, default-features = true } -rococo-system-emulated-network = { workspace = true } rococo-westend-system-emulated-network = { workspace = true } testnet-parachains-constants = { features = ["rococo", "westend"], workspace = true, default-features = true } diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/send_xcm.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/send_xcm.rs index 64f02ef4baead..8c663e111c312 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/send_xcm.rs +++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/send_xcm.rs @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use rococo_system_emulated_network::rococo_emulated_chain::rococo_runtime::Dmp; +use rococo_westend_system_emulated_network::rococo_emulated_chain::rococo_runtime::Dmp; use crate::tests::*; diff --git a/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/Cargo.toml b/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/Cargo.toml deleted file mode 100644 index 51d47f929ad4e..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/Cargo.toml +++ /dev/null @@ -1,28 +0,0 @@ -[package] -name = "coretime-rococo-integration-tests" -version = "0.0.0" -authors.workspace = true -edition.workspace = true -license = "Apache-2.0" -description = "Coretime Rococo runtime integration tests with xcm-emulator" -publish = false - -[lints] -workspace = true - -[dependencies] -# Substrate -frame-support = { workspace = true } -pallet-broker = { workspace = true, default-features = true } -pallet-message-queue = { workspace = true } -sp-runtime = { workspace = true } - -# Polkadot -polkadot-runtime-parachains = { workspace = true, default-features = true } -rococo-runtime-constants = { workspace = true, default-features = true } -xcm = { workspace = true } - -# Cumulus -cumulus-pallet-parachain-system = { workspace = true, default-features = true } -emulated-integration-tests-common = { workspace = true } -rococo-system-emulated-network = { workspace = true } diff --git a/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/lib.rs b/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/lib.rs deleted file mode 100644 index 728414f060e15..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/lib.rs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#[cfg(test)] -mod imports { - - // Substrate - pub(crate) use frame_support::assert_ok; - - // Polkadot - pub(crate) use xcm::{latest::ROCOCO_GENESIS_HASH, prelude::*}; - - // Cumulus - pub(crate) use emulated_integration_tests_common::xcm_emulator::{ - assert_expected_events, Chain, Parachain, TestExt, - }; - pub(crate) use rococo_system_emulated_network::{ - asset_hub_rococo_emulated_chain::genesis::ED as ASSET_HUB_ROCOCO_ED, - coretime_rococo_emulated_chain::{ - coretime_rococo_runtime::ExistentialDeposit as CoretimeRococoExistentialDeposit, - genesis::ED as CORETIME_ROCOCO_ED, CoretimeRococoParaPallet as CoretimeRococoPallet, - }, - rococo_emulated_chain::{genesis::ED as ROCOCO_ED, RococoRelayPallet as RococoPallet}, - AssetHubRococoPara as AssetHubRococo, AssetHubRococoParaReceiver as AssetHubRococoReceiver, - AssetHubRococoParaSender as AssetHubRococoSender, CoretimeRococoPara as CoretimeRococo, - CoretimeRococoParaReceiver as CoretimeRococoReceiver, - CoretimeRococoParaSender as CoretimeRococoSender, RococoRelay as Rococo, - RococoRelayReceiver as RococoReceiver, RococoRelaySender as RococoSender, - }; -} - -#[cfg(test)] -mod tests; diff --git a/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/tests/claim_assets.rs b/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/tests/claim_assets.rs deleted file mode 100644 index ba275eaaf8a9b..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/tests/claim_assets.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Tests related to claiming assets trapped during XCM execution. - -use crate::imports::*; - -use emulated_integration_tests_common::test_chain_can_claim_assets; - -#[test] -fn assets_can_be_claimed() { - let amount = CoretimeRococoExistentialDeposit::get(); - let assets: Assets = (Parent, amount).into(); - - test_chain_can_claim_assets!( - CoretimeRococo, - RuntimeCall, - NetworkId::ByGenesis(ROCOCO_GENESIS_HASH), - assets, - amount - ); -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/tests/coretime_interface.rs b/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/tests/coretime_interface.rs deleted file mode 100644 index 554025e1ecfed..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/tests/coretime_interface.rs +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::imports::*; -use frame_support::traits::OnInitialize; -use pallet_broker::{ConfigRecord, Configuration, CoreAssignment, CoreMask, ScheduleItem}; -use rococo_runtime_constants::system_parachain::coretime::TIMESLICE_PERIOD; -use rococo_system_emulated_network::rococo_emulated_chain::rococo_runtime::Dmp; -use sp_runtime::Perbill; - -#[test] -fn transact_hardcoded_weights_are_sane() { - // There are three transacts with hardcoded weights sent from the Coretime Chain to the Relay - // Chain across the CoretimeInterface which are triggered at various points in the sales cycle. - // - Request core count - triggered directly by `start_sales` or `request_core_count` - // extrinsics. - // - Request revenue info - triggered when each timeslice is committed. - // - Assign core - triggered when an entry is encountered in the workplan for the next - // timeslice. - - // RuntimeEvent aliases to avoid warning from usage of qualified paths in assertions due to - // - type CoretimeEvent = ::RuntimeEvent; - type RelayEvent = ::RuntimeEvent; - - Rococo::execute_with(|| { - Dmp::make_parachain_reachable(CoretimeRococo::para_id()); - }); - - // Reserve a workload, configure broker and start sales. - CoretimeRococo::execute_with(|| { - // Hooks don't run in emulated tests - workaround as we need `on_initialize` to tick things - // along and have no concept of time passing otherwise. - ::Broker::on_initialize( - ::System::block_number(), - ); - - let coretime_root_origin = ::RuntimeOrigin::root(); - - // Create and populate schedule with the worst case assignment on this core. - let mut schedule = Vec::new(); - for i in 0..80 { - schedule.push(ScheduleItem { - mask: CoreMask::void().set(i), - assignment: CoreAssignment::Task(2000 + i), - }) - } - - assert_ok!(::Broker::reserve( - coretime_root_origin.clone(), - schedule.try_into().expect("Vector is within bounds."), - )); - - // Configure broker and start sales. - let config = ConfigRecord { - advance_notice: 1, - interlude_length: 1, - leadin_length: 2, - region_length: 1, - ideal_bulk_proportion: Perbill::from_percent(40), - limit_cores_offered: None, - renewal_bump: Perbill::from_percent(2), - contribution_timeout: 1, - }; - assert_ok!(::Broker::configure( - coretime_root_origin.clone(), - config - )); - assert_ok!(::Broker::start_sales( - coretime_root_origin, - 100, - 0 - )); - assert_eq!( - pallet_broker::Status::<::Runtime>::get() - .unwrap() - .core_count, - 1 - ); - - assert_expected_events!( - CoretimeRococo, - vec![ - CoretimeEvent::Broker( - pallet_broker::Event::ReservationMade { .. } - ) => {}, - CoretimeEvent::Broker( - pallet_broker::Event::CoreCountRequested { core_count: 1 } - ) => {}, - CoretimeEvent::ParachainSystem( - cumulus_pallet_parachain_system::Event::UpwardMessageSent { .. } - ) => {}, - ] - ); - }); - - // Check that the request_core_count message was processed successfully. This will fail if the - // weights are misconfigured. - Rococo::execute_with(|| { - Rococo::assert_ump_queue_processed(true, Some(CoretimeRococo::para_id()), None); - - assert_expected_events!( - Rococo, - vec![ - RelayEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); - }); - - // Keep track of the relay chain block number so we can fast forward while still checking the - // right block. - let mut block_number_cursor = Rococo::ext_wrapper(::System::block_number); - - let config = CoretimeRococo::ext_wrapper(|| { - Configuration::<::Runtime>::get() - .expect("Pallet was configured earlier.") - }); - - // Now run up to the block before the sale is rotated. - while block_number_cursor < TIMESLICE_PERIOD - config.advance_notice - 1 { - CoretimeRococo::execute_with(|| { - // Hooks don't run in emulated tests - workaround. - ::Broker::on_initialize( - ::System::block_number(), - ); - }); - - Rococo::ext_wrapper(|| { - block_number_cursor = ::System::block_number(); - }); - } - - // In this block we trigger assign core. - CoretimeRococo::execute_with(|| { - // Hooks don't run in emulated tests - workaround. - ::Broker::on_initialize( - ::System::block_number(), - ); - - assert_expected_events!( - CoretimeRococo, - vec![ - CoretimeEvent::Broker( - pallet_broker::Event::SaleInitialized { .. } - ) => {}, - CoretimeEvent::Broker( - pallet_broker::Event::CoreAssigned { .. } - ) => {}, - CoretimeEvent::ParachainSystem( - cumulus_pallet_parachain_system::Event::UpwardMessageSent { .. } - ) => {}, - ] - ); - }); - - // Check that the assign_core message was processed successfully. - // This will fail if the weights are misconfigured. - Rococo::execute_with(|| { - Rococo::assert_ump_queue_processed(true, Some(CoretimeRococo::para_id()), None); - - assert_expected_events!( - Rococo, - vec![ - RelayEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - RelayEvent::Coretime( - polkadot_runtime_parachains::coretime::Event::CoreAssigned { .. } - ) => {}, - ] - ); - }); - - // In this block we trigger request revenue. - CoretimeRococo::execute_with(|| { - // Hooks don't run in emulated tests - workaround. - ::Broker::on_initialize( - ::System::block_number(), - ); - - assert_expected_events!( - CoretimeRococo, - vec![ - CoretimeEvent::ParachainSystem( - cumulus_pallet_parachain_system::Event::UpwardMessageSent { .. } - ) => {}, - ] - ); - }); - - // Check that the request_revenue_info_at message was processed successfully. - // This will fail if the weights are misconfigured. - Rococo::execute_with(|| { - Rococo::assert_ump_queue_processed(true, Some(CoretimeRococo::para_id()), None); - - assert_expected_events!( - Rococo, - vec![ - RelayEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - ] - ); - }); - - // Here we receive and process the notify_revenue XCM with zero revenue. - CoretimeRococo::execute_with(|| { - // Hooks don't run in emulated tests - workaround. - ::Broker::on_initialize( - ::System::block_number(), - ); - - assert_expected_events!( - CoretimeRococo, - vec![ - CoretimeEvent::MessageQueue( - pallet_message_queue::Event::Processed { success: true, .. } - ) => {}, - // Zero revenue in first timeslice so history is immediately dropped. - CoretimeEvent::Broker( - pallet_broker::Event::HistoryDropped { when: 0, revenue: 0 } - ) => {}, - ] - ); - }); -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/tests/mod.rs deleted file mode 100644 index f5e5b167de831..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/tests/mod.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -mod claim_assets; -mod coretime_interface; -mod teleport; diff --git a/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/tests/teleport.rs b/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/tests/teleport.rs deleted file mode 100644 index 3ca72b1e7a662..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo/src/tests/teleport.rs +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::imports::*; -use emulated_integration_tests_common::{ - test_parachain_is_trusted_teleporter, test_parachain_is_trusted_teleporter_for_relay, - test_relay_is_trusted_teleporter, -}; - -#[test] -fn teleport_via_limited_teleport_assets_from_and_to_relay() { - let amount = ROCOCO_ED * 10; - let native_asset: Assets = (Here, amount).into(); - - test_relay_is_trusted_teleporter!( - Rococo, // Origin - vec![CoretimeRococo], // Destinations - (native_asset, amount), - limited_teleport_assets - ); - - test_parachain_is_trusted_teleporter_for_relay!( - CoretimeRococo, // Origin - Rococo, // Destination - amount, - limited_teleport_assets - ); -} - -#[test] -fn teleport_via_transfer_assets_from_and_to_relay() { - let amount = ROCOCO_ED * 10; - let native_asset: Assets = (Here, amount).into(); - - test_relay_is_trusted_teleporter!( - Rococo, // Origin - vec![CoretimeRococo], // Destinations - (native_asset, amount), - transfer_assets - ); - - test_parachain_is_trusted_teleporter_for_relay!( - CoretimeRococo, // Origin - Rococo, // Destination - amount, - transfer_assets - ); -} - -#[test] -fn teleport_via_limited_teleport_assets_from_coretime_to_asset_hub() { - let amount = ASSET_HUB_ROCOCO_ED * 100; - let native_asset: Assets = (Parent, amount).into(); - - test_parachain_is_trusted_teleporter!( - CoretimeRococo, // Origin - vec![AssetHubRococo], // Destinations - (native_asset, amount), - limited_teleport_assets - ); -} - -#[test] -fn teleport_via_transfer_assets_from_coretime_to_asset_hub() { - let amount = ASSET_HUB_ROCOCO_ED * 100; - let native_asset: Assets = (Parent, amount).into(); - - test_parachain_is_trusted_teleporter!( - CoretimeRococo, // Origin - vec![AssetHubRococo], // Destinations - (native_asset, amount), - transfer_assets - ); -} - -#[test] -fn teleport_via_limited_teleport_assets_from_asset_hub_to_coretime() { - let amount = CORETIME_ROCOCO_ED * 100; - let native_asset: Assets = (Parent, amount).into(); - - test_parachain_is_trusted_teleporter!( - AssetHubRococo, // Origin - vec![CoretimeRococo], // Destinations - (native_asset, amount), - limited_teleport_assets - ); -} - -#[test] -fn teleport_via_transfer_assets_from_asset_hub_to_coretime() { - let amount = CORETIME_ROCOCO_ED * 100; - let native_asset: Assets = (Parent, amount).into(); - - test_parachain_is_trusted_teleporter!( - AssetHubRococo, // Origin - vec![CoretimeRococo], // Destinations - (native_asset, amount), - transfer_assets - ); -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/Cargo.toml b/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/Cargo.toml deleted file mode 100644 index f6886a4b09268..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "people-rococo-integration-tests" -version = "0.1.0" -authors.workspace = true -edition.workspace = true -license = "Apache-2.0" -description = "People Rococo runtime integration tests with xcm-emulator" -publish = false - -[lints] -workspace = true - -[dependencies] -# Substrate -frame-support = { workspace = true } -pallet-balances = { workspace = true } -sp-runtime = { workspace = true } - -# Polkadot -xcm = { workspace = true } -xcm-executor = { workspace = true } - -# Cumulus -asset-test-utils = { workspace = true, default-features = true } -emulated-integration-tests-common = { workspace = true } -parachains-common = { workspace = true, default-features = true } -rococo-system-emulated-network = { workspace = true } diff --git a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/lib.rs b/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/lib.rs deleted file mode 100644 index 0a0a1cb42a346..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/lib.rs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#[cfg(test)] -mod imports { - // Substrate - pub(crate) use frame_support::sp_runtime::DispatchResult; - - // Polkadot - pub(crate) use xcm::{latest::ROCOCO_GENESIS_HASH, prelude::*}; - - // Cumulus - pub(crate) use asset_test_utils::xcm_helpers; - pub(crate) use emulated_integration_tests_common::xcm_emulator::{ - assert_expected_events, bx, Chain, Parachain as Para, Test, TestArgs, TestContext, TestExt, - }; - pub(crate) use parachains_common::Balance; - pub(crate) use rococo_system_emulated_network::{ - people_rococo_emulated_chain::{ - people_rococo_runtime::{ - xcm_config::XcmConfig as PeopleRococoXcmConfig, - ExistentialDeposit as PeopleRococoExistentialDeposit, - }, - PeopleRococoParaPallet as PeopleRococoPallet, - }, - rococo_emulated_chain::{genesis::ED as ROCOCO_ED, RococoRelayPallet as RococoPallet}, - AssetHubRococoPara as AssetHubRococo, AssetHubRococoParaReceiver as AssetHubRococoReceiver, - PeopleRococoPara as PeopleRococo, PeopleRococoParaReceiver as PeopleRococoReceiver, - PeopleRococoParaSender as PeopleRococoSender, RococoRelay as Rococo, - RococoRelayReceiver as RococoReceiver, RococoRelaySender as RococoSender, - }; - - pub(crate) type SystemParaToRelayTest = Test; -} - -#[cfg(test)] -mod tests; diff --git a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/claim_assets.rs b/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/claim_assets.rs deleted file mode 100644 index 32b5537832a45..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/claim_assets.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Tests related to claiming assets trapped during XCM execution. - -use crate::imports::*; - -use emulated_integration_tests_common::test_chain_can_claim_assets; - -#[test] -fn assets_can_be_claimed() { - let amount = PeopleRococoExistentialDeposit::get(); - let assets: Assets = (Parent, amount).into(); - - test_chain_can_claim_assets!( - PeopleRococo, - RuntimeCall, - NetworkId::ByGenesis(ROCOCO_GENESIS_HASH), - assets, - amount - ); -} diff --git a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/mod.rs b/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/mod.rs deleted file mode 100644 index 08749b295dc21..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/mod.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -mod claim_assets; -mod teleport; diff --git a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/teleport.rs b/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/teleport.rs deleted file mode 100644 index 3f0a0f974f834..0000000000000 --- a/cumulus/parachains/integration-tests/emulated/tests/people/people-rococo/src/tests/teleport.rs +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::imports::*; -use emulated_integration_tests_common::{ - test_parachain_is_trusted_teleporter, test_parachain_is_trusted_teleporter_for_relay, - test_relay_is_trusted_teleporter, -}; - -#[test] -fn teleport_via_limited_teleport_assets_from_and_to_relay() { - let amount = ROCOCO_ED * 100; - let native_asset: Assets = (Here, amount).into(); - - test_relay_is_trusted_teleporter!( - Rococo, - vec![PeopleRococo], - (native_asset, amount), - limited_teleport_assets - ); - - test_parachain_is_trusted_teleporter_for_relay!( - PeopleRococo, - Rococo, - amount, - limited_teleport_assets - ); -} - -#[test] -fn teleport_via_transfer_assets_from_and_to_relay() { - let amount = ROCOCO_ED * 100; - let native_asset: Assets = (Here, amount).into(); - - test_relay_is_trusted_teleporter!( - Rococo, - vec![PeopleRococo], - (native_asset, amount), - transfer_assets - ); - - test_parachain_is_trusted_teleporter_for_relay!(PeopleRococo, Rococo, amount, transfer_assets); -} - -#[test] -fn teleport_via_limited_teleport_assets_to_other_system_parachains_works() { - let amount = ROCOCO_ED * 100; - let native_asset: Assets = (Parent, amount).into(); - - test_parachain_is_trusted_teleporter!( - PeopleRococo, // Origin - vec![AssetHubRococo], // Destinations - (native_asset, amount), - limited_teleport_assets - ); -} - -#[test] -fn teleport_via_transfer_assets_to_other_system_parachains_works() { - let amount = ROCOCO_ED * 100; - let native_asset: Assets = (Parent, amount).into(); - - test_parachain_is_trusted_teleporter!( - PeopleRococo, // Origin - vec![AssetHubRococo], // Destinations - (native_asset, amount), - transfer_assets - ); -} - -fn relay_dest_assertions_fail(_t: SystemParaToRelayTest) { - Rococo::assert_ump_queue_processed(false, Some(PeopleRococo::para_id()), None); -} - -fn para_origin_assertions(t: SystemParaToRelayTest) { - type RuntimeEvent = ::RuntimeEvent; - - PeopleRococo::assert_xcm_pallet_attempted_complete(None); - - PeopleRococo::assert_parachain_system_ump_sent(); - - assert_expected_events!( - PeopleRococo, - vec![ - // Amount is withdrawn from Sender's account - RuntimeEvent::Balances(pallet_balances::Event::Burned { who, amount }) => { - who: *who == t.sender.account_id, - amount: *amount == t.args.amount, - }, - ] - ); -} - -fn system_para_limited_teleport_assets(t: SystemParaToRelayTest) -> DispatchResult { - ::PolkadotXcm::limited_teleport_assets( - t.signed_origin, - bx!(t.args.dest.into()), - bx!(t.args.beneficiary.into()), - bx!(t.args.assets.into()), - t.args.fee_asset_item, - t.args.weight_limit, - ) -} - -/// Limited Teleport of native asset from System Parachain to Relay Chain -/// shouldn't work when there is not enough balance in Relay Chain's `CheckAccount` -#[test] -fn limited_teleport_native_assets_from_system_para_to_relay_fails() { - // Init values for Relay Chain - let amount_to_send: Balance = ROCOCO_ED * 1000; - let destination = PeopleRococo::parent_location(); - let beneficiary_id = RococoReceiver::get(); - let assets = (Parent, amount_to_send).into(); - - // Fund a sender - PeopleRococo::fund_accounts(vec![(PeopleRococoSender::get(), ROCOCO_ED * 2_000u128)]); - - let test_args = TestContext { - sender: PeopleRococoSender::get(), - receiver: RococoReceiver::get(), - args: TestArgs::new_para(destination, beneficiary_id, amount_to_send, assets, None, 0), - }; - - let mut test = SystemParaToRelayTest::new(test_args); - - let sender_balance_before = test.sender.balance; - let receiver_balance_before = test.receiver.balance; - - test.set_assertion::(para_origin_assertions); - test.set_assertion::(relay_dest_assertions_fail); - test.set_dispatchable::(system_para_limited_teleport_assets); - test.assert(); - - let sender_balance_after = test.sender.balance; - let receiver_balance_after = test.receiver.balance; - - let delivery_fees = PeopleRococo::execute_with(|| { - xcm_helpers::teleport_assets_delivery_fees::< - ::XcmSender, - >( - test.args.assets.clone(), 0, test.args.weight_limit, test.args.beneficiary, test.args.dest - ) - }); - - // Sender's balance is reduced - assert_eq!(sender_balance_before - amount_to_send - delivery_fees, sender_balance_after); - // Receiver's balance does not change - assert_eq!(receiver_balance_after, receiver_balance_before); -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml b/cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml deleted file mode 100644 index 6320dd8ef4400..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/Cargo.toml +++ /dev/null @@ -1,228 +0,0 @@ -[package] -name = "coretime-rococo-runtime" -version = "0.1.0" -authors.workspace = true -edition.workspace = true -description = "Rococo's Coretime parachain runtime" -license = "Apache-2.0" -homepage.workspace = true -repository.workspace = true - -[lints] -workspace = true - -[dependencies] -codec = { features = ["derive"], workspace = true } -scale-info = { features = ["derive"], workspace = true } -serde = { optional = true, features = ["derive"], workspace = true, default-features = true } -serde_json = { features = ["alloc"], workspace = true } -tracing = { workspace = true } - -# Substrate -frame-benchmarking = { optional = true, workspace = true } -frame-executive = { workspace = true } -frame-metadata-hash-extension = { workspace = true } -frame-support = { workspace = true } -frame-system = { workspace = true } -frame-system-benchmarking = { optional = true, workspace = true } -frame-system-rpc-runtime-api = { workspace = true } -frame-try-runtime = { optional = true, workspace = true } -pallet-aura = { workspace = true } -pallet-authorship = { workspace = true } -pallet-balances = { workspace = true } -pallet-broker = { workspace = true } -pallet-message-queue = { workspace = true } -pallet-multisig = { workspace = true } -pallet-proxy = { workspace = true } -pallet-session = { workspace = true } -pallet-sudo = { workspace = true } -pallet-timestamp = { workspace = true } -pallet-transaction-payment = { workspace = true } -pallet-transaction-payment-rpc-runtime-api = { workspace = true } -pallet-utility = { workspace = true } -sp-api = { workspace = true } -sp-block-builder = { workspace = true } -sp-consensus-aura = { workspace = true } -sp-core = { workspace = true } -sp-genesis-builder = { workspace = true } -sp-inherents = { workspace = true } -sp-keyring = { workspace = true } -sp-offchain = { workspace = true } -sp-runtime = { workspace = true } -sp-session = { workspace = true } -sp-storage = { workspace = true } -sp-transaction-pool = { workspace = true } -sp-version = { workspace = true } - -# Polkadot -pallet-xcm = { workspace = true } -pallet-xcm-benchmarks = { optional = true, workspace = true } -polkadot-parachain-primitives = { workspace = true } -polkadot-runtime-common = { workspace = true } -rococo-runtime-constants = { workspace = true } -xcm = { workspace = true } -xcm-builder = { workspace = true } -xcm-executor = { workspace = true } -xcm-runtime-apis = { workspace = true } - -# Cumulus -cumulus-pallet-aura-ext = { workspace = true } -cumulus-pallet-parachain-system = { workspace = true } -cumulus-pallet-session-benchmarking = { workspace = true } -cumulus-pallet-weight-reclaim = { workspace = true } -cumulus-pallet-xcm = { workspace = true } -cumulus-pallet-xcmp-queue = { workspace = true } -cumulus-primitives-aura = { workspace = true } -cumulus-primitives-core = { workspace = true } -cumulus-primitives-utility = { workspace = true } -pallet-collator-selection = { workspace = true } -parachain-info = { workspace = true } -parachains-common = { workspace = true } -testnet-parachains-constants = { features = ["rococo"], workspace = true } - -[dev-dependencies] -parachains-runtimes-test-utils = { workspace = true } - -[build-dependencies] -substrate-wasm-builder = { optional = true, workspace = true, default-features = true } - -[features] -default = ["std"] -std = [ - "codec/std", - "cumulus-pallet-aura-ext/std", - "cumulus-pallet-parachain-system/std", - "cumulus-pallet-session-benchmarking/std", - "cumulus-pallet-weight-reclaim/std", - "cumulus-pallet-xcm/std", - "cumulus-pallet-xcmp-queue/std", - "cumulus-primitives-aura/std", - "cumulus-primitives-core/std", - "cumulus-primitives-utility/std", - "frame-benchmarking?/std", - "frame-executive/std", - "frame-metadata-hash-extension/std", - "frame-support/std", - "frame-system-benchmarking?/std", - "frame-system-rpc-runtime-api/std", - "frame-system/std", - "frame-try-runtime?/std", - "pallet-aura/std", - "pallet-authorship/std", - "pallet-balances/std", - "pallet-broker/std", - "pallet-collator-selection/std", - "pallet-message-queue/std", - "pallet-multisig/std", - "pallet-proxy/std", - "pallet-session/std", - "pallet-sudo/std", - "pallet-timestamp/std", - "pallet-transaction-payment-rpc-runtime-api/std", - "pallet-transaction-payment/std", - "pallet-utility/std", - "pallet-xcm-benchmarks?/std", - "pallet-xcm/std", - "parachain-info/std", - "parachains-common/std", - "parachains-runtimes-test-utils/std", - "polkadot-parachain-primitives/std", - "polkadot-runtime-common/std", - "rococo-runtime-constants/std", - "scale-info/std", - "serde", - "serde_json/std", - "sp-api/std", - "sp-block-builder/std", - "sp-consensus-aura/std", - "sp-core/std", - "sp-genesis-builder/std", - "sp-inherents/std", - "sp-keyring/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-storage/std", - "sp-transaction-pool/std", - "sp-version/std", - "substrate-wasm-builder", - "testnet-parachains-constants/std", - "tracing/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm-runtime-apis/std", - "xcm/std", -] -runtime-benchmarks = [ - "cumulus-pallet-parachain-system/runtime-benchmarks", - "cumulus-pallet-session-benchmarking/runtime-benchmarks", - "cumulus-pallet-weight-reclaim/runtime-benchmarks", - "cumulus-pallet-xcmp-queue/runtime-benchmarks", - "cumulus-primitives-core/runtime-benchmarks", - "cumulus-primitives-utility/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system-benchmarking/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-broker/runtime-benchmarks", - "pallet-collator-selection/runtime-benchmarks", - "pallet-message-queue/runtime-benchmarks", - "pallet-multisig/runtime-benchmarks", - "pallet-proxy/runtime-benchmarks", - "pallet-session/runtime-benchmarks", - "pallet-sudo/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", - "pallet-transaction-payment/runtime-benchmarks", - "pallet-utility/runtime-benchmarks", - "pallet-xcm-benchmarks/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", - "parachains-common/runtime-benchmarks", - "polkadot-parachain-primitives/runtime-benchmarks", - "polkadot-runtime-common/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", - "xcm-executor/runtime-benchmarks", - "xcm-runtime-apis/runtime-benchmarks", - "xcm/runtime-benchmarks", -] -try-runtime = [ - "cumulus-pallet-aura-ext/try-runtime", - "cumulus-pallet-parachain-system/try-runtime", - "cumulus-pallet-weight-reclaim/try-runtime", - "cumulus-pallet-xcm/try-runtime", - "cumulus-pallet-xcmp-queue/try-runtime", - "frame-executive/try-runtime", - "frame-support/try-runtime", - "frame-system/try-runtime", - "frame-try-runtime/try-runtime", - "pallet-aura/try-runtime", - "pallet-authorship/try-runtime", - "pallet-balances/try-runtime", - "pallet-broker/try-runtime", - "pallet-collator-selection/try-runtime", - "pallet-message-queue/try-runtime", - "pallet-multisig/try-runtime", - "pallet-proxy/try-runtime", - "pallet-session/try-runtime", - "pallet-sudo/try-runtime", - "pallet-timestamp/try-runtime", - "pallet-transaction-payment/try-runtime", - "pallet-utility/try-runtime", - "pallet-xcm/try-runtime", - "parachain-info/try-runtime", - "parachains-common/try-runtime", - "polkadot-runtime-common/try-runtime", - "sp-runtime/try-runtime", -] -fast-runtime = [ - "rococo-runtime-constants/fast-runtime", -] - -# Enable the metadata hash generation in the wasm builder. -metadata-hash = ["substrate-wasm-builder/metadata-hash"] - -# A feature that should be enabled when the runtime should be built for on-chain -# deployment. This will disable stuff that shouldn't be part of the on-chain wasm -# to make it smaller, like logging for example. -on-chain-release-build = ["metadata-hash"] diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/build.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/build.rs deleted file mode 100644 index 368a1e427aaaf..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/build.rs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#[cfg(all(not(feature = "metadata-hash"), feature = "std"))] -fn main() { - substrate_wasm_builder::WasmBuilder::build_using_defaults(); - - substrate_wasm_builder::WasmBuilder::init_with_defaults() - .set_file_name("fast_runtime_binary.rs") - .enable_feature("fast-runtime") - .build(); -} - -#[cfg(all(feature = "metadata-hash", feature = "std"))] -fn main() { - substrate_wasm_builder::WasmBuilder::init_with_defaults() - .enable_metadata_hash("ROC", 12) - .build(); - - substrate_wasm_builder::WasmBuilder::init_with_defaults() - .set_file_name("fast_runtime_binary.rs") - .enable_feature("fast-runtime") - .enable_metadata_hash("ROC", 12) - .build(); -} - -#[cfg(not(feature = "std"))] -fn main() {} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/coretime.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/coretime.rs deleted file mode 100644 index ef78397fb3e63..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/coretime.rs +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// This file is part of Cumulus. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use crate::{xcm_config::LocationToAccountId, *}; -use codec::{Decode, Encode}; -use cumulus_pallet_parachain_system::RelaychainDataProvider; -use cumulus_primitives_core::relay_chain; -use frame_support::{ - parameter_types, - traits::{ - fungible::{Balanced, Credit, Inspect}, - tokens::{Fortitude, Preservation}, - DefensiveResult, OnUnbalanced, - }, -}; -use frame_system::Pallet as System; -use pallet_broker::{ - CoreAssignment, CoreIndex, CoretimeInterface, PartsOf57600, RCBlockNumberOf, TaskId, -}; -use parachains_common::{AccountId, Balance}; -use rococo_runtime_constants::system_parachain::coretime; -use sp_runtime::traits::{AccountIdConversion, MaybeConvert}; -use xcm::latest::prelude::*; -use xcm_executor::traits::{ConvertLocation, TransactAsset}; - -pub struct BurnCoretimeRevenue; -impl OnUnbalanced> for BurnCoretimeRevenue { - fn on_nonzero_unbalanced(amount: Credit) { - let acc = RevenueAccumulationAccount::get(); - if !System::::account_exists(&acc) { - System::::inc_providers(&acc); - } - Balances::resolve(&acc, amount).defensive_ok(); - } -} - -type AssetTransactor = ::AssetTransactor; - -fn burn_at_relay(stash: &AccountId, value: Balance) -> Result<(), XcmError> { - let dest = Location::parent(); - let stash_location = - Junction::AccountId32 { network: None, id: stash.clone().into() }.into_location(); - let asset = Asset { id: AssetId(Location::parent()), fun: Fungible(value) }; - let dummy_xcm_context = XcmContext { origin: None, message_id: [0; 32], topic: None }; - - let withdrawn = AssetTransactor::withdraw_asset(&asset, &stash_location, None)?; - - AssetTransactor::can_check_out(&dest, &asset, &dummy_xcm_context)?; - - let parent_assets = Into::::into(withdrawn) - .reanchored(&dest, &Here.into()) - .defensive_map_err(|_| XcmError::ReanchorFailed)?; - - PolkadotXcm::send_xcm( - Here, - Location::parent(), - Xcm(vec![ - Instruction::UnpaidExecution { - weight_limit: WeightLimit::Unlimited, - check_origin: None, - }, - ReceiveTeleportedAsset(parent_assets.clone()), - BurnAsset(parent_assets), - ]), - )?; - - AssetTransactor::check_out(&dest, &asset, &dummy_xcm_context); - - Ok(()) -} - -/// A type containing the encoding of the coretime pallet in the Relay chain runtime. Used to -/// construct any remote calls. The codec index must correspond to the index of `Coretime` in the -/// `construct_runtime` of the Relay chain. -#[derive(Encode, Decode)] -enum RelayRuntimePallets { - #[codec(index = 74)] - Coretime(CoretimeProviderCalls), -} - -/// Call encoding for the calls needed from the relay coretime pallet. -#[derive(Encode, Decode)] -enum CoretimeProviderCalls { - #[codec(index = 1)] - RequestCoreCount(CoreIndex), - #[codec(index = 2)] - RequestRevenueInfoAt(relay_chain::BlockNumber), - #[codec(index = 3)] - CreditAccount(AccountId, Balance), - #[codec(index = 4)] - AssignCore( - CoreIndex, - relay_chain::BlockNumber, - Vec<(CoreAssignment, PartsOf57600)>, - Option, - ), -} - -parameter_types! { - pub const BrokerPalletId: PalletId = PalletId(*b"py/broke"); - pub const MinimumCreditPurchase: Balance = UNITS / 10; - pub RevenueAccumulationAccount: AccountId = BrokerPalletId::get().into_sub_account_truncating(b"burnstash"); - pub const MinimumEndPrice: Balance = UNITS; -} - -/// Type that implements the `CoretimeInterface` for the allocation of Coretime. Meant to operate -/// from the parachain context. That is, the parachain provides a market (broker) for the sale of -/// coretime, but assumes a `CoretimeProvider` (i.e. a Relay Chain) to actually provide cores. -pub struct CoretimeAllocator; -impl CoretimeInterface for CoretimeAllocator { - type AccountId = AccountId; - type Balance = Balance; - type RelayChainBlockNumberProvider = RelaychainDataProvider; - - fn request_core_count(count: CoreIndex) { - use crate::coretime::CoretimeProviderCalls::RequestCoreCount; - let request_core_count_call = RelayRuntimePallets::Coretime(RequestCoreCount(count)); - - let message = Xcm(vec![ - Instruction::UnpaidExecution { - weight_limit: WeightLimit::Unlimited, - check_origin: None, - }, - Instruction::Transact { - origin_kind: OriginKind::Native, - call: request_core_count_call.encode().into(), - fallback_max_weight: Some(Weight::from_parts(1_000_000_000, 200_000)), - }, - ]); - - match PolkadotXcm::send_xcm(Here, Location::parent(), message.clone()) { - Ok(_) => tracing::info!( - target: "runtime::coretime", - "Request to update schedulable cores sent successfully." - ), - Err(e) => tracing::error!( - target: "runtime::coretime", error=?e, - "Failed to send request to update schedulable cores", - ), - } - } - - fn request_revenue_info_at(when: RCBlockNumberOf) { - use crate::coretime::CoretimeProviderCalls::RequestRevenueInfoAt; - let request_revenue_info_at_call = - RelayRuntimePallets::Coretime(RequestRevenueInfoAt(when)); - - let message = Xcm(vec![ - Instruction::UnpaidExecution { - weight_limit: WeightLimit::Unlimited, - check_origin: None, - }, - Instruction::Transact { - origin_kind: OriginKind::Native, - call: request_revenue_info_at_call.encode().into(), - fallback_max_weight: Some(Weight::from_parts(1_000_000_000, 200_000)), - }, - ]); - - match PolkadotXcm::send_xcm(Here, Location::parent(), message.clone()) { - Ok(_) => tracing::info!( - target: "runtime::coretime", - "Request for revenue information sent successfully." - ), - Err(e) => tracing::error!( - target: "runtime::coretime", error=?e, - "Request for revenue information failed to send" - ), - } - } - - fn credit_account(who: Self::AccountId, amount: Self::Balance) { - use crate::coretime::CoretimeProviderCalls::CreditAccount; - let credit_account_call = RelayRuntimePallets::Coretime(CreditAccount(who, amount)); - - let message = Xcm(vec![ - Instruction::UnpaidExecution { - weight_limit: WeightLimit::Unlimited, - check_origin: None, - }, - Instruction::Transact { - origin_kind: OriginKind::Native, - call: credit_account_call.encode().into(), - fallback_max_weight: Some(Weight::from_parts(1_000_000_000, 200_000)), - }, - ]); - - match PolkadotXcm::send_xcm(Here, Location::parent(), message.clone()) { - Ok(_) => tracing::info!( - target: "runtime::coretime", - "Instruction to credit account sent successfully." - ), - Err(e) => tracing::error!( - target: "runtime::coretime", error=?e, - "Instruction to credit account failed to send" - ), - } - } - - fn assign_core( - core: CoreIndex, - begin: RCBlockNumberOf, - assignment: Vec<(CoreAssignment, PartsOf57600)>, - end_hint: Option>, - ) { - use crate::coretime::CoretimeProviderCalls::AssignCore; - - // The relay chain currently only allows `assign_core` to be called with a complete mask - // and only ever with increasing `begin`. The assignments must be truncated to avoid - // dropping that core's assignment completely. - - // This shadowing of `assignment` is temporary and can be removed when the relay can accept - // multiple messages to assign a single core. - let assignment = if assignment.len() > 28 { - let mut total_parts = 0u16; - // Account for missing parts with a new `Idle` assignment at the start as - // `assign_core` on the relay assumes this is sorted. We'll add the rest of the - // assignments and sum the parts in one pass, so this is just initialized to 0. - let mut assignment_truncated = vec![(CoreAssignment::Idle, 0)]; - // Truncate to first 27 non-idle assignments. - assignment_truncated.extend( - assignment - .into_iter() - .filter(|(a, _)| *a != CoreAssignment::Idle) - .take(27) - .inspect(|(_, parts)| total_parts += *parts) - .collect::>(), - ); - - // Set the parts of the `Idle` assignment we injected at the start of the vec above. - assignment_truncated[0].1 = 57_600u16.saturating_sub(total_parts); - assignment_truncated - } else { - assignment - }; - - let assign_core_call = - RelayRuntimePallets::Coretime(AssignCore(core, begin, assignment, end_hint)); - - let message = Xcm(vec![ - Instruction::UnpaidExecution { - weight_limit: WeightLimit::Unlimited, - check_origin: None, - }, - Instruction::Transact { - origin_kind: OriginKind::Native, - call: assign_core_call.encode().into(), - fallback_max_weight: Some(Weight::from_parts(1_000_000_000, 200_000)), - }, - ]); - - match PolkadotXcm::send_xcm(Here, Location::parent(), message.clone()) { - Ok(_) => tracing::info!( - target: "runtime::coretime", - "Core assignment sent successfully." - ), - Err(e) => tracing::error!( - target: "runtime::coretime", error=?e, - "Core assignment failed to send" - ), - } - } - - fn on_new_timeslice(_t: pallet_broker::Timeslice) { - let stash = RevenueAccumulationAccount::get(); - let value = - Balances::reducible_balance(&stash, Preservation::Expendable, Fortitude::Polite); - - if value > 0 { - tracing::debug!(target: "runtime::coretime", %value, "Going to burn stashed tokens at RC"); - match burn_at_relay(&stash, value) { - Ok(()) => { - tracing::debug!(target: "runtime::coretime", %value, "Successfully burnt tokens"); - }, - Err(err) => { - tracing::error!(target: "runtime::coretime", error=?err, "burn_at_relay failed"); - }, - } - } - } -} - -pub struct SovereignAccountOf; -impl MaybeConvert for SovereignAccountOf { - fn maybe_convert(id: TaskId) -> Option { - // Currently all tasks are parachains. - let location = Location::new(1, [Parachain(id)]); - LocationToAccountId::convert_location(&location) - } -} - -impl pallet_broker::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Currency = Balances; - type OnRevenue = BurnCoretimeRevenue; - type TimeslicePeriod = ConstU32<{ coretime::TIMESLICE_PERIOD }>; - type MaxLeasedCores = ConstU32<50>; - type MaxReservedCores = ConstU32<10>; - type Coretime = CoretimeAllocator; - type ConvertBalance = sp_runtime::traits::Identity; - type WeightInfo = weights::pallet_broker::WeightInfo; - type PalletId = BrokerPalletId; - type AdminOrigin = EnsureRoot; - type SovereignAccountOf = SovereignAccountOf; - type MaxAutoRenewals = ConstU32<100>; - type PriceAdapter = pallet_broker::MinimumPrice; - type MinimumCreditPurchase = MinimumCreditPurchase; -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/genesis_config_presets.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/genesis_config_presets.rs deleted file mode 100644 index 296def2ce2769..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/genesis_config_presets.rs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! # Coretime Rococo Runtime genesis config presets - -use crate::*; -use alloc::{vec, vec::Vec}; -use cumulus_primitives_core::ParaId; -use frame_support::build_struct_json_patch; -use parachains_common::{AccountId, AuraId}; -use sp_genesis_builder::PresetId; -use sp_keyring::Sr25519Keyring; -use testnet_parachains_constants::rococo::{currency::UNITS as ROC, xcm_version::SAFE_XCM_VERSION}; - -const CORETIME_ROCOCO_ED: Balance = ExistentialDeposit::get(); -pub const CORETIME_PARA_ID: ParaId = ParaId::new(1005); - -fn coretime_rococo_genesis( - invulnerables: Vec<(AccountId, AuraId)>, - endowed_accounts: Vec, - endowment: Balance, - id: ParaId, -) -> serde_json::Value { - build_struct_json_patch!(RuntimeGenesisConfig { - balances: BalancesConfig { - balances: endowed_accounts.iter().cloned().map(|k| (k, endowment)).collect(), - }, - parachain_info: ParachainInfoConfig { parachain_id: id }, - collator_selection: CollatorSelectionConfig { - invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), - candidacy_bond: CORETIME_ROCOCO_ED * 16, - }, - session: SessionConfig { - keys: invulnerables - .into_iter() - .map(|(acc, aura)| { - ( - acc.clone(), // account id - acc, // validator id - SessionKeys { aura }, // session keys - ) - }) - .collect(), - }, - polkadot_xcm: PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION) }, - sudo: SudoConfig { key: Some(Sr25519Keyring::Alice.to_account_id()) } - }) -} - -/// Provides the JSON representation of predefined genesis config for given `id`. -pub fn get_preset(id: &PresetId) -> Option> { - let patch = match id.as_ref() { - sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET => coretime_rococo_genesis( - // initial collators. - vec![ - (Sr25519Keyring::Alice.to_account_id(), Sr25519Keyring::Alice.public().into()), - (Sr25519Keyring::Bob.to_account_id(), Sr25519Keyring::Bob.public().into()), - ], - Sr25519Keyring::well_known().map(|x| x.to_account_id()).collect(), - ROC * 1_000_000, - CORETIME_PARA_ID, - ), - sp_genesis_builder::DEV_RUNTIME_PRESET => coretime_rococo_genesis( - // initial collators. - vec![(Sr25519Keyring::Alice.to_account_id(), Sr25519Keyring::Alice.public().into())], - vec![ - Sr25519Keyring::Alice.to_account_id(), - Sr25519Keyring::Bob.to_account_id(), - Sr25519Keyring::AliceStash.to_account_id(), - Sr25519Keyring::BobStash.to_account_id(), - ], - ROC * 1_000_000, - CORETIME_PARA_ID, - ), - _ => return None, - }; - - Some( - serde_json::to_string(&patch) - .expect("serialization to json is expected to work. qed.") - .into_bytes(), - ) -} - -/// List of supported presets. -pub fn preset_names() -> Vec { - vec![ - PresetId::from(sp_genesis_builder::DEV_RUNTIME_PRESET), - PresetId::from(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET), - ] -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs deleted file mode 100644 index 3edf3c43adef2..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs +++ /dev/null @@ -1,1200 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#![cfg_attr(not(feature = "std"), no_std)] -// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. -#![recursion_limit = "256"] - -// Make the WASM binary available. -#[cfg(feature = "std")] -include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); - -/// Provides the `WASM_BINARY` build with `fast-runtime` feature enabled. -/// -/// This is for example useful for local test chains. -#[cfg(feature = "std")] -pub mod fast_runtime_binary { - include!(concat!(env!("OUT_DIR"), "/fast_runtime_binary.rs")); -} - -mod coretime; -mod genesis_config_presets; -mod weights; -pub mod xcm_config; - -extern crate alloc; - -use alloc::{vec, vec::Vec}; -use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; -use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; -use frame_support::{ - construct_runtime, derive_impl, - dispatch::DispatchClass, - genesis_builder_helper::{build_state, get_preset}, - parameter_types, - traits::{ - ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter, TransformOrigin, - }, - weights::{ConstantMultiplier, Weight}, - PalletId, -}; -use frame_system::{ - limits::{BlockLength, BlockWeights}, - EnsureRoot, -}; -use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; -use parachains_common::{ - impls::DealWithFees, - message_queue::{NarrowOriginToSibling, ParaIdToSibling}, - AccountId, AuraId, Balance, BlockNumber, Hash, Header, Nonce, Signature, - AVERAGE_ON_INITIALIZE_RATIO, NORMAL_DISPATCH_RATIO, -}; -use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; -use sp_api::impl_runtime_apis; -use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; -#[cfg(any(feature = "std", test))] -pub use sp_runtime::BuildStorage; -use sp_runtime::{ - generic, impl_opaque_keys, - traits::{BlakeTwo256, Block as BlockT, BlockNumberProvider}, - transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, Debug, DispatchError, MultiAddress, Perbill, -}; -#[cfg(feature = "std")] -use sp_version::NativeVersion; -use sp_version::RuntimeVersion; -use testnet_parachains_constants::rococo::{consensus::*, currency::*, fee::WeightToFee, time::*}; -use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; -use xcm::{prelude::*, Version as XcmVersion}; -use xcm_config::{ - FellowshipLocation, GovernanceLocation, RocRelayLocation, XcmConfig, - XcmOriginToTransactDispatchOrigin, -}; -use xcm_runtime_apis::{ - dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects}, - fees::Error as XcmPaymentApiError, -}; - -/// The address format for describing accounts. -pub type Address = MultiAddress; - -/// Block type as expected by this runtime. -pub type Block = generic::Block; - -/// A Block signed with a Justification -pub type SignedBlock = generic::SignedBlock; - -/// BlockId type as expected by this runtime. -pub type BlockId = generic::BlockId; - -/// The TransactionExtension to the basic transaction logic. -pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim< - Runtime, - ( - frame_system::AuthorizeCall, - frame_system::CheckNonZeroSender, - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_transaction_payment::ChargeTransactionPayment, - frame_metadata_hash_extension::CheckMetadataHash, - ), ->; - -/// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = - generic::UncheckedExtrinsic; - -/// Migrations to apply on runtime upgrade. -pub type Migrations = ( - pallet_collator_selection::migration::v2::MigrationToV2, - cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4, - cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, - pallet_broker::migration::MigrateV0ToV1, - pallet_broker::migration::MigrateV1ToV2, - pallet_broker::migration::MigrateV2ToV3, - pallet_broker::migration::MigrateV3ToV4, - pallet_session::migrations::v1::MigrateV0ToV1< - Runtime, - pallet_session::migrations::v1::InitOffenceSeverity, - >, - // permanent - pallet_xcm::migration::MigrateToLatestXcmVersion, - cumulus_pallet_aura_ext::migration::MigrateV0ToV1, -); - -/// Executive: handles dispatch to the various modules. -pub type Executive = frame_executive::Executive< - Runtime, - Block, - frame_system::ChainContext, - Runtime, - AllPalletsWithSystem, ->; - -impl_opaque_keys! { - pub struct SessionKeys { - pub aura: Aura, - } -} - -#[sp_version::runtime_version] -pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: alloc::borrow::Cow::Borrowed("coretime-rococo"), - impl_name: alloc::borrow::Cow::Borrowed("coretime-rococo"), - authoring_version: 1, - spec_version: 1_020_001, - impl_version: 0, - apis: RUNTIME_API_VERSIONS, - transaction_version: 2, - system_version: 1, -}; - -/// The version information used to identify this runtime when compiled natively. -#[cfg(feature = "std")] -pub fn native_version() -> NativeVersion { - NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } -} - -parameter_types! { - pub const Version: RuntimeVersion = VERSION; - pub RuntimeBlockLength: BlockLength = - BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); - pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() - .base_block(BlockExecutionWeight::get()) - .for_class(DispatchClass::all(), |weights| { - weights.base_extrinsic = ExtrinsicBaseWeight::get(); - }) - .for_class(DispatchClass::Normal, |weights| { - weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); - }) - .for_class(DispatchClass::Operational, |weights| { - weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); - // Operational transactions have some extra reserved space, so that they - // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. - weights.reserved = Some( - MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT - ); - }) - .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) - .build_or_panic(); - pub const SS58Prefix: u8 = 42; -} - -// Configure FRAME pallets to include in runtime. -#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig)] -impl frame_system::Config for Runtime { - /// The identifier used to distinguish between accounts. - type AccountId = AccountId; - /// The nonce type for storing how many extrinsics an account has signed. - type Nonce = Nonce; - /// The type for hashing blocks and tries. - type Hash = Hash; - /// The block type. - type Block = Block; - /// Maximum number of block number to block hash mappings to keep (oldest pruned first). - type BlockHashCount = BlockHashCount; - /// Runtime version. - type Version = Version; - /// The data to be stored in an account. - type AccountData = pallet_balances::AccountData; - /// The weight of database operations that the runtime can invoke. - type DbWeight = RocksDbWeight; - /// Weight information for the extrinsics of this pallet. - type SystemWeightInfo = weights::frame_system::WeightInfo; - /// Weight information for the extensions of this pallet. - type ExtensionsWeightInfo = weights::frame_system_extensions::WeightInfo; - /// Block & extrinsics weights: base values and limits. - type BlockWeights = RuntimeBlockWeights; - /// The maximum length of a block (in bytes). - type BlockLength = RuntimeBlockLength; - type SS58Prefix = SS58Prefix; - /// The action to take on a Runtime Upgrade - type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; - type MaxConsumers = ConstU32<16>; - type SingleBlockMigrations = Migrations; -} - -impl cumulus_pallet_weight_reclaim::Config for Runtime { - type WeightInfo = weights::cumulus_pallet_weight_reclaim::WeightInfo; -} - -impl pallet_timestamp::Config for Runtime { - /// A timestamp: milliseconds since the unix epoch. - type Moment = u64; - type OnTimestampSet = Aura; - type MinimumPeriod = ConstU64<0>; - type WeightInfo = weights::pallet_timestamp::WeightInfo; -} - -impl pallet_authorship::Config for Runtime { - type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type EventHandler = (CollatorSelection,); -} - -parameter_types! { - pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; -} - -impl pallet_balances::Config for Runtime { - type Balance = Balance; - type DustRemoval = (); - type RuntimeEvent = RuntimeEvent; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = weights::pallet_balances::WeightInfo; - type MaxLocks = ConstU32<50>; - type MaxReserves = ConstU32<50>; - type ReserveIdentifier = [u8; 8]; - type RuntimeHoldReason = RuntimeHoldReason; - type RuntimeFreezeReason = RuntimeFreezeReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; - type DoneSlashHandler = (); -} - -parameter_types! { - /// Relay Chain `TransactionByteFee` / 10 - pub const TransactionByteFee: Balance = MILLICENTS; -} - -impl pallet_transaction_payment::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type OnChargeTransaction = - pallet_transaction_payment::FungibleAdapter>; - type OperationalFeeMultiplier = ConstU8<5>; - type WeightToFee = WeightToFee; - type LengthToFee = ConstantMultiplier; - type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; - type WeightInfo = weights::pallet_transaction_payment::WeightInfo; -} - -parameter_types! { - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); - pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; -} - -impl cumulus_pallet_parachain_system::Config for Runtime { - type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo; - type RuntimeEvent = RuntimeEvent; - type OnSystemEvent = (); - type SelfParaId = parachain_info::Pallet; - type DmpQueue = frame_support::traits::EnqueueWithOrigin; - type OutboundXcmpMessageSource = XcmpQueue; - type ReservedDmpWeight = ReservedDmpWeight; - type XcmpMessageHandler = XcmpQueue; - type ReservedXcmpWeight = ReservedXcmpWeight; - type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; - type ConsensusHook = ConsensusHook; - type RelayParentOffset = ConstU32<0>; -} - -type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< - Runtime, - RELAY_CHAIN_SLOT_DURATION_MILLIS, - BLOCK_PROCESSING_VELOCITY, - UNINCLUDED_SEGMENT_CAPACITY, ->; - -parameter_types! { - pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; -} - -impl pallet_message_queue::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = weights::pallet_message_queue::WeightInfo; - #[cfg(feature = "runtime-benchmarks")] - type MessageProcessor = pallet_message_queue::mock_helpers::NoopMessageProcessor< - cumulus_primitives_core::AggregateMessageOrigin, - >; - #[cfg(not(feature = "runtime-benchmarks"))] - type MessageProcessor = xcm_builder::ProcessXcmMessage< - AggregateMessageOrigin, - xcm_executor::XcmExecutor, - RuntimeCall, - >; - type Size = u32; - // The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin: - type QueueChangeHandler = NarrowOriginToSibling; - type QueuePausedQuery = NarrowOriginToSibling; - type HeapSize = sp_core::ConstU32<{ 103 * 1024 }>; - type MaxStale = sp_core::ConstU32<8>; - type ServiceWeight = MessageQueueServiceWeight; - type IdleMaxServiceWeight = MessageQueueServiceWeight; -} - -impl parachain_info::Config for Runtime {} - -impl cumulus_pallet_aura_ext::Config for Runtime {} - -parameter_types! { - /// Fellows pluralistic body. - pub const FellowsBodyId: BodyId = BodyId::Technical; -} - -/// Privileged origin that represents Root or Fellows pluralistic body. -pub type RootOrFellows = EitherOfDiverse< - EnsureRoot, - EnsureXcm>, ->; - -parameter_types! { - /// The asset ID for the asset that we use to pay for message delivery fees. - pub FeeAssetId: AssetId = AssetId(RocRelayLocation::get()); - /// The base fee for the message delivery fees. - pub const BaseDeliveryFee: u128 = CENTS.saturating_mul(3); -} - -pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice< - FeeAssetId, - BaseDeliveryFee, - TransactionByteFee, - XcmpQueue, ->; - -impl cumulus_pallet_xcmp_queue::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type ChannelInfo = ParachainSystem; - type VersionWrapper = PolkadotXcm; - type XcmpQueue = TransformOrigin; - type MaxInboundSuspended = ConstU32<1_000>; - type MaxActiveOutboundChannels = ConstU32<128>; - // Most on-chain HRMP channels are configured to use 102400 bytes of max message size, so we - // need to set the page size larger than that until we reduce the channel size on-chain. - type MaxPageSize = ConstU32<{ 103 * 1024 }>; - type ControllerOrigin = RootOrFellows; - type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; - type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; - type PriceForSiblingDelivery = PriceForSiblingParachainDelivery; -} - -impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime { - // This must be the same as the `ChannelInfo` from the `Config`: - type ChannelList = ParachainSystem; -} - -pub const PERIOD: u32 = 6 * HOURS; -pub const OFFSET: u32 = 0; - -impl pallet_session::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type ValidatorId = ::AccountId; - // we don't have stash and controller, thus we don't need the convert as well. - type ValidatorIdOf = pallet_collator_selection::IdentityCollator; - type ShouldEndSession = pallet_session::PeriodicSessions, ConstU32>; - type NextSessionRotation = pallet_session::PeriodicSessions, ConstU32>; - type SessionManager = CollatorSelection; - // Essentially just Aura, but let's be pedantic. - type SessionHandler = ::KeyTypeIdProviders; - type Keys = SessionKeys; - type DisablingStrategy = (); - type WeightInfo = weights::pallet_session::WeightInfo; - type Currency = Balances; - type KeyDeposit = (); -} - -impl pallet_aura::Config for Runtime { - type AuthorityId = AuraId; - type DisabledValidators = (); - type MaxAuthorities = ConstU32<100_000>; - type AllowMultipleBlocksPerSlot = ConstBool; - type SlotDuration = ConstU64; -} - -parameter_types! { - pub const PotId: PalletId = PalletId(*b"PotStake"); - pub const SessionLength: BlockNumber = 6 * HOURS; - /// StakingAdmin pluralistic body. - pub const StakingAdminBodyId: BodyId = BodyId::Defense; -} - -/// We allow Root and the `StakingAdmin` to execute privileged collator selection operations. -pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< - EnsureRoot, - EnsureXcm>, ->; - -impl pallet_collator_selection::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Currency = Balances; - type UpdateOrigin = CollatorSelectionUpdateOrigin; - type PotId = PotId; - type MaxCandidates = ConstU32<100>; - type MinEligibleCollators = ConstU32<4>; - type MaxInvulnerables = ConstU32<20>; - // should be a multiple of session or things will get inconsistent - type KickThreshold = ConstU32; - type ValidatorId = ::AccountId; - type ValidatorIdOf = pallet_collator_selection::IdentityCollator; - type ValidatorRegistration = Session; - type WeightInfo = weights::pallet_collator_selection::WeightInfo; -} - -parameter_types! { - /// One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes. - pub const DepositBase: Balance = deposit(1, 88); - /// Additional storage item size of 32 bytes. - pub const DepositFactor: Balance = deposit(0, 32); -} - -impl pallet_multisig::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type Currency = Balances; - type DepositBase = DepositBase; - type DepositFactor = DepositFactor; - type MaxSignatories = ConstU32<100>; - type WeightInfo = weights::pallet_multisig::WeightInfo; - type BlockNumberProvider = frame_system::Pallet; -} - -/// The type used to represent the kinds of proxying allowed. -#[derive( - Copy, - Clone, - Eq, - PartialEq, - Ord, - PartialOrd, - Encode, - Decode, - DecodeWithMemTracking, - Debug, - MaxEncodedLen, - scale_info::TypeInfo, -)] -pub enum ProxyType { - /// Fully permissioned proxy. Can execute any call on behalf of _proxied_. - Any, - /// Can execute any call that does not transfer funds or assets. - NonTransfer, - /// Proxy with the ability to reject time-delay proxy announcements. - CancelProxy, - /// Proxy for all Broker pallet calls. - Broker, - /// Proxy for renewing coretime. - CoretimeRenewer, - /// Proxy able to purchase on-demand coretime credits. - OnDemandPurchaser, - /// Collator selection proxy. Can execute calls related to collator selection mechanism. - Collator, -} -impl Default for ProxyType { - fn default() -> Self { - Self::Any - } -} - -impl InstanceFilter for ProxyType { - fn filter(&self, c: &RuntimeCall) -> bool { - match self { - ProxyType::Any => true, - ProxyType::NonTransfer => !matches!( - c, - RuntimeCall::Balances { .. } | - // `purchase`, `renew`, `transfer` and `purchase_credit` are pretty self explanatory. - RuntimeCall::Broker(pallet_broker::Call::purchase { .. }) | - RuntimeCall::Broker(pallet_broker::Call::renew { .. }) | - RuntimeCall::Broker(pallet_broker::Call::transfer { .. }) | - RuntimeCall::Broker(pallet_broker::Call::purchase_credit { .. }) | - // `pool` doesn't transfer, but it defines the account to be paid for contributions - RuntimeCall::Broker(pallet_broker::Call::pool { .. }) | - // `assign` is essentially a transfer of a region NFT - RuntimeCall::Broker(pallet_broker::Call::assign { .. }) - ), - ProxyType::CancelProxy => matches!( - c, - RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | - RuntimeCall::Utility { .. } | - RuntimeCall::Multisig { .. } - ), - ProxyType::Broker => { - matches!( - c, - RuntimeCall::Broker { .. } | - RuntimeCall::Utility { .. } | - RuntimeCall::Multisig { .. } - ) - }, - ProxyType::CoretimeRenewer => { - matches!( - c, - RuntimeCall::Broker(pallet_broker::Call::renew { .. }) | - RuntimeCall::Utility { .. } | - RuntimeCall::Multisig { .. } - ) - }, - ProxyType::OnDemandPurchaser => { - matches!( - c, - RuntimeCall::Broker(pallet_broker::Call::purchase_credit { .. }) | - RuntimeCall::Utility { .. } | - RuntimeCall::Multisig { .. } - ) - }, - ProxyType::Collator => matches!( - c, - RuntimeCall::CollatorSelection { .. } | - RuntimeCall::Utility { .. } | - RuntimeCall::Multisig { .. } - ), - } - } - - fn is_superset(&self, o: &Self) -> bool { - match (self, o) { - (x, y) if x == y => true, - (ProxyType::Any, _) => true, - (_, ProxyType::Any) => false, - (ProxyType::Broker, ProxyType::CoretimeRenewer) => true, - (ProxyType::Broker, ProxyType::OnDemandPurchaser) => true, - (ProxyType::NonTransfer, ProxyType::Collator) => true, - _ => false, - } - } -} - -parameter_types! { - // One storage item; key size 32, value size 8; . - pub const ProxyDepositBase: Balance = deposit(1, 40); - // Additional storage item size of 33 bytes. - pub const ProxyDepositFactor: Balance = deposit(0, 33); - pub const MaxProxies: u16 = 32; - // One storage item; key size 32, value size 16 - pub const AnnouncementDepositBase: Balance = deposit(1, 48); - pub const AnnouncementDepositFactor: Balance = deposit(0, 66); - pub const MaxPending: u16 = 32; -} - -impl pallet_proxy::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type Currency = Balances; - type ProxyType = ProxyType; - type ProxyDepositBase = ProxyDepositBase; - type ProxyDepositFactor = ProxyDepositFactor; - type MaxProxies = MaxProxies; - type WeightInfo = weights::pallet_proxy::WeightInfo; - type MaxPending = MaxPending; - type CallHasher = BlakeTwo256; - type AnnouncementDepositBase = AnnouncementDepositBase; - type AnnouncementDepositFactor = AnnouncementDepositFactor; - type BlockNumberProvider = frame_system::Pallet; -} - -impl pallet_utility::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type PalletsOrigin = OriginCaller; - type WeightInfo = weights::pallet_utility::WeightInfo; -} - -impl pallet_sudo::Config for Runtime { - type RuntimeCall = RuntimeCall; - type RuntimeEvent = RuntimeEvent; - type WeightInfo = pallet_sudo::weights::SubstrateWeight; -} - -pub struct BrokerMigrationV4BlockConversion; - -impl pallet_broker::migration::v4::BlockToRelayHeightConversion - for BrokerMigrationV4BlockConversion -{ - fn convert_block_number_to_relay_height(input_block_number: u32) -> u32 { - let relay_height = pallet_broker::RCBlockNumberProviderOf::< - ::Coretime, - >::current_block_number(); - let parachain_block_number = frame_system::Pallet::::block_number(); - let offset = relay_height - parachain_block_number * 2; - offset + input_block_number * 2 - } - - fn convert_block_length_to_relay_length(input_block_length: u32) -> u32 { - input_block_length * 2 - } -} - -// Create the runtime by composing the FRAME pallets that were previously configured. -construct_runtime!( - pub enum Runtime - { - // System support stuff. - System: frame_system = 0, - ParachainSystem: cumulus_pallet_parachain_system = 1, - Timestamp: pallet_timestamp = 3, - ParachainInfo: parachain_info = 4, - WeightReclaim: cumulus_pallet_weight_reclaim = 5, - - // Monetary stuff. - Balances: pallet_balances = 10, - TransactionPayment: pallet_transaction_payment = 11, - - // Collator support. The order of these 5 are important and shall not change. - Authorship: pallet_authorship = 20, - CollatorSelection: pallet_collator_selection = 21, - Session: pallet_session = 22, - Aura: pallet_aura = 23, - AuraExt: cumulus_pallet_aura_ext = 24, - - // XCM & related - XcmpQueue: cumulus_pallet_xcmp_queue = 30, - PolkadotXcm: pallet_xcm = 31, - CumulusXcm: cumulus_pallet_xcm = 32, - MessageQueue: pallet_message_queue = 34, - - // Handy utilities. - Utility: pallet_utility = 40, - Multisig: pallet_multisig = 41, - Proxy: pallet_proxy = 42, - - // The main stage. - Broker: pallet_broker = 50, - - // Sudo - Sudo: pallet_sudo = 100, - } -); - -#[cfg(feature = "runtime-benchmarks")] -mod benches { - frame_benchmarking::define_benchmarks!( - [frame_system, SystemBench::] - [cumulus_pallet_parachain_system, ParachainSystem] - [pallet_timestamp, Timestamp] - [pallet_balances, Balances] - [pallet_broker, Broker] - [pallet_collator_selection, CollatorSelection] - [pallet_session, SessionBench::] - [cumulus_pallet_xcmp_queue, XcmpQueue] - [pallet_xcm, PalletXcmExtrinsicsBenchmark::] - [pallet_message_queue, MessageQueue] - [pallet_multisig, Multisig] - [pallet_proxy, Proxy] - [pallet_utility, Utility] - // NOTE: Make sure you point to the individual modules below. - [pallet_xcm_benchmarks::fungible, XcmBalances] - [pallet_xcm_benchmarks::generic, XcmGeneric] - [cumulus_pallet_weight_reclaim, WeightReclaim] - ); -} - -impl_runtime_apis! { - impl sp_consensus_aura::AuraApi for Runtime { - fn slot_duration() -> sp_consensus_aura::SlotDuration { - sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION) - } - - fn authorities() -> Vec { - pallet_aura::Authorities::::get().into_inner() - } - } - - impl cumulus_primitives_core::RelayParentOffsetApi for Runtime { - fn relay_parent_offset() -> u32 { - 0 - } - } - - impl cumulus_primitives_aura::AuraUnincludedSegmentApi for Runtime { - fn can_build_upon( - included_hash: ::Hash, - slot: cumulus_primitives_aura::Slot, - ) -> bool { - ConsensusHook::can_build_upon(included_hash, slot) - } - } - - impl sp_api::Core for Runtime { - fn version() -> RuntimeVersion { - VERSION - } - - fn execute_block(block: ::LazyBlock) { - Executive::execute_block(block) - } - - fn initialize_block(header: &::Header) -> sp_runtime::ExtrinsicInclusionMode { - Executive::initialize_block(header) - } - } - - impl sp_api::Metadata for Runtime { - fn metadata() -> OpaqueMetadata { - OpaqueMetadata::new(Runtime::metadata().into()) - } - - fn metadata_at_version(version: u32) -> Option { - Runtime::metadata_at_version(version) - } - - fn metadata_versions() -> alloc::vec::Vec { - Runtime::metadata_versions() - } - } - - impl sp_block_builder::BlockBuilder for Runtime { - fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { - Executive::apply_extrinsic(extrinsic) - } - - fn finalize_block() -> ::Header { - Executive::finalize_block() - } - - fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<::Extrinsic> { - data.create_extrinsics() - } - - fn check_inherents( - block: ::LazyBlock, - data: sp_inherents::InherentData, - ) -> sp_inherents::CheckInherentsResult { - data.check_extrinsics(&block) - } - } - - impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { - fn validate_transaction( - source: TransactionSource, - tx: ::Extrinsic, - block_hash: ::Hash, - ) -> TransactionValidity { - Executive::validate_transaction(source, tx, block_hash) - } - } - - impl sp_offchain::OffchainWorkerApi for Runtime { - fn offchain_worker(header: &::Header) { - Executive::offchain_worker(header) - } - } - - impl sp_session::SessionKeys for Runtime { - fn generate_session_keys(seed: Option>) -> Vec { - SessionKeys::generate(seed) - } - - fn decode_session_keys( - encoded: Vec, - ) -> Option, KeyTypeId)>> { - SessionKeys::decode_into_raw_public_keys(&encoded) - } - } - - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Nonce { - System::account_nonce(account) - } - } - - impl pallet_broker::runtime_api::BrokerApi for Runtime { - fn sale_price() -> Result { - Broker::current_price() - } - } - - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi for Runtime { - fn query_info( - uxt: ::Extrinsic, - len: u32, - ) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo { - TransactionPayment::query_info(uxt, len) - } - fn query_fee_details( - uxt: ::Extrinsic, - len: u32, - ) -> pallet_transaction_payment::FeeDetails { - TransactionPayment::query_fee_details(uxt, len) - } - fn query_weight_to_fee(weight: Weight) -> Balance { - TransactionPayment::weight_to_fee(weight) - } - fn query_length_to_fee(length: u32) -> Balance { - TransactionPayment::length_to_fee(length) - } - } - - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi - for Runtime - { - fn query_call_info( - call: RuntimeCall, - len: u32, - ) -> pallet_transaction_payment::RuntimeDispatchInfo { - TransactionPayment::query_call_info(call, len) - } - fn query_call_fee_details( - call: RuntimeCall, - len: u32, - ) -> pallet_transaction_payment::FeeDetails { - TransactionPayment::query_call_fee_details(call, len) - } - fn query_weight_to_fee(weight: Weight) -> Balance { - TransactionPayment::weight_to_fee(weight) - } - fn query_length_to_fee(length: u32) -> Balance { - TransactionPayment::length_to_fee(length) - } - } - - impl xcm_runtime_apis::fees::XcmPaymentApi for Runtime { - fn query_acceptable_payment_assets(xcm_version: xcm::Version) -> Result, XcmPaymentApiError> { - let acceptable_assets = vec![AssetId(xcm_config::RocRelayLocation::get())]; - PolkadotXcm::query_acceptable_payment_assets(xcm_version, acceptable_assets) - } - - fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result { - type Trader = ::Trader; - PolkadotXcm::query_weight_to_asset_fee::(weight, asset) - } - - fn query_xcm_weight(message: VersionedXcm<()>) -> Result { - PolkadotXcm::query_xcm_weight(message) - } - - fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>, asset_id: VersionedAssetId) -> Result { - type AssetExchanger = ::AssetExchanger; - PolkadotXcm::query_delivery_fees::(destination, message, asset_id) - } - } - - impl xcm_runtime_apis::dry_run::DryRunApi for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result, XcmDryRunApiError> { - PolkadotXcm::dry_run_call::(origin, call, result_xcms_version) - } - - fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm) -> Result, XcmDryRunApiError> { - PolkadotXcm::dry_run_xcm::(origin_location, xcm) - } - } - - impl xcm_runtime_apis::conversions::LocationToAccountApi for Runtime { - fn convert_location(location: VersionedLocation) -> Result< - AccountId, - xcm_runtime_apis::conversions::Error - > { - xcm_runtime_apis::conversions::LocationToAccountHelper::< - AccountId, - xcm_config::LocationToAccountId, - >::convert_location(location) - } - } - - impl cumulus_primitives_core::CollectCollationInfo for Runtime { - fn collect_collation_info(header: &::Header) -> cumulus_primitives_core::CollationInfo { - ParachainSystem::collect_collation_info(header) - } - } - - #[cfg(feature = "try-runtime")] - impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { - let weight = Executive::try_runtime_upgrade(checks).unwrap(); - (weight, RuntimeBlockWeights::get().max_block) - } - - fn execute_block( - block: ::LazyBlock, - state_root_check: bool, - signature_check: bool, - select: frame_try_runtime::TryStateSelect, - ) -> Weight { - // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to - // have a backtrace here. - Executive::try_execute_block(block, state_root_check, signature_check, select).unwrap() - } - } - - #[cfg(feature = "runtime-benchmarks")] - impl frame_benchmarking::Benchmark for Runtime { - fn benchmark_metadata(extra: bool) -> ( - Vec, - Vec, - ) { - use frame_benchmarking::BenchmarkList; - use frame_support::traits::StorageInfoTrait; - use frame_system_benchmarking::Pallet as SystemBench; - use cumulus_pallet_session_benchmarking::Pallet as SessionBench; - use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark; - - // This is defined once again in dispatch_benchmark, because list_benchmarks! - // and add_benchmarks! are macros exported by define_benchmarks! macros and those types - // are referenced in that call. - type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; - type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::; - - let mut list = Vec::::new(); - list_benchmarks!(list, extra); - - let storage_info = AllPalletsWithSystem::storage_info(); - (list, storage_info) - } - - #[allow(non_local_definitions)] - fn dispatch_benchmark( - config: frame_benchmarking::BenchmarkConfig - ) -> Result, alloc::string::String> { - use frame_benchmarking::{BenchmarkBatch, BenchmarkError}; - use sp_storage::TrackedStorageKey; - - use frame_system_benchmarking::Pallet as SystemBench; - impl frame_system_benchmarking::Config for Runtime { - fn setup_set_code_requirements(code: &alloc::vec::Vec) -> Result<(), BenchmarkError> { - ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32); - Ok(()) - } - - fn verify_set_code() { - System::assert_last_event(cumulus_pallet_parachain_system::Event::::ValidationFunctionStored.into()); - } - } - - use cumulus_pallet_session_benchmarking::Pallet as SessionBench; - impl cumulus_pallet_session_benchmarking::Config for Runtime {} - - use xcm::latest::prelude::*; - use xcm_config::RocRelayLocation; - - use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark; - use testnet_parachains_constants::rococo::locations::{AssetHubParaId, AssetHubLocation}; - - parameter_types! { - pub ExistentialDepositAsset: Option = Some(( - RocRelayLocation::get(), - ExistentialDeposit::get() - ).into()); - } - - impl pallet_xcm::benchmarking::Config for Runtime { - type DeliveryHelper = - polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - PriceForSiblingParachainDelivery, - AssetHubParaId, - ParachainSystem, - >; - - fn reachable_dest() -> Option { - Some(AssetHubLocation::get()) - } - - fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { - // Relay/native token can be teleported between AH and Relay. - Some(( - Asset { - fun: Fungible(ExistentialDeposit::get()), - id: AssetId(RocRelayLocation::get()) - }, - AssetHubLocation::get(), - )) - } - - fn reserve_transferable_asset_and_dest() -> Option<(Asset, Location)> { - // Coretime chain can reserve transfer regions to some random parachain. - - // Properties of a mock region: - let core = 0; - let begin = 0; - let end = 42; - - let region_id = pallet_broker::Pallet::::issue(core, begin, pallet_broker::CoreMask::complete(), end, None, None); - Some(( - Asset { - fun: NonFungible(Index(region_id.into())), - id: AssetId(xcm_config::BrokerPalletLocation::get()) - }, - AssetHubLocation::get(), - )) - } - - fn set_up_complex_asset_transfer() -> Option<(Assets, u32, Location, alloc::boxed::Box)> { - let native_location = Parent.into(); - let dest = AssetHubLocation::get(); - - pallet_xcm::benchmarking::helpers::native_teleport_as_asset_transfer::( - native_location, - dest, - ) - } - - fn get_asset() -> Asset { - Asset { - id: AssetId(RocRelayLocation::get()), - fun: Fungible(ExistentialDeposit::get()), - } - } - } - - impl pallet_xcm_benchmarks::Config for Runtime { - type XcmConfig = xcm_config::XcmConfig; - type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - PriceForSiblingParachainDelivery, - AssetHubParaId, - ParachainSystem, - >; - type AccountIdConverter = xcm_config::LocationToAccountId; - fn valid_destination() -> Result { - Ok(AssetHubLocation::get()) - } - fn worst_case_holding(_depositable_count: u32) -> Assets { - // just concrete assets according to relay chain. - let assets: Vec = vec![ - Asset { - id: AssetId(RocRelayLocation::get()), - fun: Fungible(1_000_000 * UNITS), - } - ]; - assets.into() - } - } - - parameter_types! { - pub TrustedTeleporter: Option<(Location, Asset)> = Some(( - AssetHubLocation::get(), - Asset { fun: Fungible(UNITS), id: AssetId(RocRelayLocation::get()) }, - )); - pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; - pub const TrustedReserve: Option<(Location, Asset)> = None; - } - - impl pallet_xcm_benchmarks::fungible::Config for Runtime { - type TransactAsset = Balances; - - type CheckedAccount = CheckedAccount; - type TrustedTeleporter = TrustedTeleporter; - type TrustedReserve = TrustedReserve; - - fn get_asset() -> Asset { - Asset { - id: AssetId(RocRelayLocation::get()), - fun: Fungible(UNITS), - } - } - } - - impl pallet_xcm_benchmarks::generic::Config for Runtime { - type RuntimeCall = RuntimeCall; - type TransactAsset = Balances; - - fn worst_case_response() -> (u64, Response) { - (0u64, Response::Version(Default::default())) - } - - fn worst_case_asset_exchange() -> Result<(Assets, Assets), BenchmarkError> { - Err(BenchmarkError::Skip) - } - - fn universal_alias() -> Result<(Location, Junction), BenchmarkError> { - Err(BenchmarkError::Skip) - } - - fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> { - Ok((AssetHubLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) - } - - fn subscribe_origin() -> Result { - Ok(AssetHubLocation::get()) - } - - fn claimable_asset() -> Result<(Location, Location, Assets), BenchmarkError> { - let origin = AssetHubLocation::get(); - let assets: Assets = (AssetId(RocRelayLocation::get()), 1_000 * UNITS).into(); - let ticket = Location { parents: 0, interior: Here }; - Ok((origin, ticket, assets)) - } - - fn worst_case_for_trader() -> Result<(Asset, WeightLimit), BenchmarkError> { - Ok((Asset { - id: AssetId(RocRelayLocation::get()), - fun: Fungible(1_000_000 * UNITS), - }, WeightLimit::Limited(Weight::from_parts(5000, 5000)))) - } - - fn unlockable_asset() -> Result<(Location, Location, Asset), BenchmarkError> { - Err(BenchmarkError::Skip) - } - - fn export_message_origin_and_destination( - ) -> Result<(Location, NetworkId, InteriorLocation), BenchmarkError> { - Err(BenchmarkError::Skip) - } - - fn alias_origin() -> Result<(Location, Location), BenchmarkError> { - Err(BenchmarkError::Skip) - } - } - - type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; - type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::; - - use frame_support::traits::WhitelistedStorageKeys; - let whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys(); - - let mut batches = Vec::::new(); - let params = (&config, &whitelist); - add_benchmarks!(params, batches); - - Ok(batches) - } - } - - impl sp_genesis_builder::GenesisBuilder for Runtime { - fn build_state(config: Vec) -> sp_genesis_builder::Result { - build_state::(config) - } - - fn get_preset(id: &Option) -> Option> { - get_preset::(id, &genesis_config_presets::get_preset) - } - - fn preset_names() -> Vec { - genesis_config_presets::preset_names() - } - } - - impl xcm_runtime_apis::trusted_query::TrustedQueryApi for Runtime { - fn is_trusted_reserve(asset: VersionedAsset, location: VersionedLocation) -> xcm_runtime_apis::trusted_query::XcmTrustedQueryResult { - PolkadotXcm::is_trusted_reserve(asset, location) - } - fn is_trusted_teleporter(asset: VersionedAsset, location: VersionedLocation) -> xcm_runtime_apis::trusted_query::XcmTrustedQueryResult { - PolkadotXcm::is_trusted_teleporter(asset, location) - } - } - - impl cumulus_primitives_core::GetParachainInfo for Runtime { - fn parachain_id() -> ParaId { - ParachainInfo::parachain_id() - } - } - - impl cumulus_primitives_core::TargetBlockRate for Runtime { - fn target_block_rate() -> u32 { - 1 - } - } -} - -cumulus_pallet_parachain_system::register_validate_block! { - Runtime = Runtime, - BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/block_weights.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/block_weights.rs deleted file mode 100644 index 3ff2b3550fbf8..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/block_weights.rs +++ /dev/null @@ -1,53 +0,0 @@ -// This file is part of Cumulus. - -// Copyright (C) 2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -pub mod constants { - use frame_support::{ - parameter_types, - weights::{constants, Weight}, - }; - - parameter_types! { - /// Importing a block with 0 Extrinsics. - pub const BlockExecutionWeight: Weight = - Weight::from_parts(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(5_000_000), 0); - } - - #[cfg(test)] - mod test_weights { - use frame_support::weights::constants; - - /// Checks that the weight exists and is sane. - // NOTE: If this test fails but you are sure that the generated values are fine, - // you can delete it. - #[test] - fn sane() { - let w = super::constants::BlockExecutionWeight::get(); - - // At least 100 µs. - assert!( - w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS, - "Weight should be at least 100 µs." - ); - // At most 50 ms. - assert!( - w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS, - "Weight should be at most 50 ms." - ); - } - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/cumulus_pallet_parachain_system.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/cumulus_pallet_parachain_system.rs deleted file mode 100644 index 73c4b2ba241d2..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/cumulus_pallet_parachain_system.rs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `cumulus_pallet_parachain_system` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `731f893ee36e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=cumulus_pallet_parachain_system -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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 `cumulus_pallet_parachain_system`. -pub struct WeightInfo(PhantomData); -impl cumulus_pallet_parachain_system::WeightInfo for WeightInfo { - /// Storage: `ParachainSystem::LastDmqMqcHead` (r:1 w:1) - /// Proof: `ParachainSystem::LastDmqMqcHead` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::ProcessedDownwardMessages` (r:0 w:1) - /// Proof: `ParachainSystem::ProcessedDownwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `MessageQueue::Pages` (r:0 w:1000) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - /// The range of component `n` is `[0, 1000]`. - fn enqueue_inbound_downward_messages(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `48` - // Estimated: `3517` - // Minimum execution time: 2_830_000 picoseconds. - Weight::from_parts(2_936_000, 0) - .saturating_add(Weight::from_parts(0, 3517)) - // Standard Error: 276_641 - .saturating_add(Weight::from_parts(362_904_401, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(4)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/cumulus_pallet_weight_reclaim.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/cumulus_pallet_weight_reclaim.rs deleted file mode 100644 index 5b84d56a9571f..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/cumulus_pallet_weight_reclaim.rs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `cumulus_pallet_weight_reclaim` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `731f893ee36e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=cumulus_pallet_weight_reclaim -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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 `cumulus_pallet_weight_reclaim`. -pub struct WeightInfo(PhantomData); -impl cumulus_pallet_weight_reclaim::WeightInfo for WeightInfo { - fn storage_weight_reclaim() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_959_000 picoseconds. - Weight::from_parts(4_279_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/cumulus_pallet_xcmp_queue.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/cumulus_pallet_xcmp_queue.rs deleted file mode 100644 index ce4116fe4f00f..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/cumulus_pallet_xcmp_queue.rs +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `cumulus_pallet_xcmp_queue` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-09-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `4e9548205c14`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=cumulus_pallet_xcmp_queue -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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 `cumulus_pallet_xcmp_queue`. -pub struct WeightInfo(PhantomData); -impl cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo { - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:1) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) - fn set_config_with_u32() -> Weight { - // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `1497` - // Minimum execution time: 5_077_000 picoseconds. - Weight::from_parts(5_373_000, 0) - .saturating_add(Weight::from_parts(0, 1497)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) - /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:0 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - /// The range of component `n` is `[0, 105467]`. - fn enqueue_n_bytes_xcmp_message(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `82` - // Estimated: `5487` - // Minimum execution time: 13_885_000 picoseconds. - Weight::from_parts(9_450_997, 0) - .saturating_add(Weight::from_parts(0, 5487)) - // Standard Error: 7 - .saturating_add(Weight::from_parts(1_035, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) - /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:0 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - /// The range of component `n` is `[0, 1000]`. - fn enqueue_n_empty_xcmp_messages(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `82` - // Estimated: `5487` - // Minimum execution time: 11_612_000 picoseconds. - Weight::from_parts(15_581_141, 0) - .saturating_add(Weight::from_parts(0, 5487)) - // Standard Error: 228 - .saturating_add(Weight::from_parts(144_913, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `Measured`) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `Measured`) - /// Storage: `MessageQueue::Pages` (r:1 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `Measured`) - /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) - /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `Measured`) - /// The range of component `n` is `[0, 105457]`. - fn enqueue_empty_xcmp_message_at(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `264 + n * (1 ±0)` - // Estimated: `3727 + n * (1 ±0)` - // Minimum execution time: 20_945_000 picoseconds. - Weight::from_parts(12_562_806, 0) - .saturating_add(Weight::from_parts(0, 3727)) - // Standard Error: 12 - .saturating_add(Weight::from_parts(2_267, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) - } - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) - /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:0 w:100) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - /// The range of component `n` is `[0, 100]`. - fn enqueue_n_full_pages(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `117` - // Estimated: `5487` - // Minimum execution time: 12_939_000 picoseconds. - Weight::from_parts(13_222_000, 0) - .saturating_add(Weight::from_parts(0, 5487)) - // Standard Error: 71_657 - .saturating_add(Weight::from_parts(98_108_432, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) - } - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `Measured`) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `Measured`) - /// Storage: `MessageQueue::Pages` (r:1 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `Measured`) - /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) - /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `Measured`) - fn enqueue_1000_small_xcmp_messages() -> Weight { - // Proof Size summary in bytes: - // Measured: `52997` - // Estimated: `56462` - // Minimum execution time: 278_327_000 picoseconds. - Weight::from_parts(289_384_000, 0) - .saturating_add(Weight::from_parts(0, 56462)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - fn suspend_channel() -> Weight { - // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `2767` - // Minimum execution time: 3_254_000 picoseconds. - Weight::from_parts(3_438_000, 0) - .saturating_add(Weight::from_parts(0, 2767)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - fn resume_channel() -> Weight { - // Proof Size summary in bytes: - // Measured: `111` - // Estimated: `2767` - // Minimum execution time: 4_465_000 picoseconds. - Weight::from_parts(4_655_000, 0) - .saturating_add(Weight::from_parts(0, 2767)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// The range of component `n` is `[0, 92]`. - fn take_first_concatenated_xcm(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_058_000 picoseconds. - Weight::from_parts(2_364_575, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 101 - .saturating_add(Weight::from_parts(16_990, 0).saturating_mul(n.into())) - } - /// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1) - /// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1) - /// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1) - /// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) - /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:0 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn on_idle_good_msg() -> Weight { - // Proof Size summary in bytes: - // Measured: `105647` - // Estimated: `109112` - // Minimum execution time: 186_856_000 picoseconds. - Weight::from_parts(198_214_000, 0) - .saturating_add(Weight::from_parts(0, 109112)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(5)) - } - /// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1) - /// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1) - /// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1) - /// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) - /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:0 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn on_idle_large_msg() -> Weight { - // Proof Size summary in bytes: - // Measured: `65716` - // Estimated: `69181` - // Minimum execution time: 121_741_000 picoseconds. - Weight::from_parts(128_847_000, 0) - .saturating_add(Weight::from_parts(0, 69181)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(5)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/extrinsic_weights.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/extrinsic_weights.rs deleted file mode 100644 index ab951aea56150..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/extrinsic_weights.rs +++ /dev/null @@ -1,53 +0,0 @@ -// This file is part of Cumulus. - -// Copyright (C) 2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -pub mod constants { - use frame_support::{ - parameter_types, - weights::{constants, Weight}, - }; - - parameter_types! { - /// Executing a NO-OP `System::remarks` Extrinsic. - pub const ExtrinsicBaseWeight: Weight = - Weight::from_parts(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(125_000), 0); - } - - #[cfg(test)] - mod test_weights { - use frame_support::weights::constants; - - /// Checks that the weight exists and is sane. - // NOTE: If this test fails but you are sure that the generated values are fine, - // you can delete it. - #[test] - fn sane() { - let w = super::constants::ExtrinsicBaseWeight::get(); - - // At least 10 µs. - assert!( - w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS, - "Weight should be at least 10 µs." - ); - // At most 1 ms. - assert!( - w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, - "Weight should be at most 1 ms." - ); - } - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/frame_system.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/frame_system.rs deleted file mode 100644 index 5c22848528bfd..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/frame_system.rs +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `frame_system` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `731f893ee36e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=frame_system -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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 `frame_system`. -pub struct WeightInfo(PhantomData); -impl frame_system::WeightInfo for WeightInfo { - /// The range of component `b` is `[0, 3932160]`. - fn remark(b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_931_000 picoseconds. - Weight::from_parts(2_108_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 163 - .saturating_add(Weight::from_parts(14_648, 0).saturating_mul(b.into())) - } - /// The range of component `b` is `[0, 3932160]`. - fn remark_with_event(b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_776_000 picoseconds. - Weight::from_parts(5_947_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 164 - .saturating_add(Weight::from_parts(16_193, 0).saturating_mul(b.into())) - } - /// Storage: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1) - /// Proof: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1) - fn set_heap_pages() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_367_000 picoseconds. - Weight::from_parts(3_583_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) - /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpgradeRestrictionSignal` (r:1 w:0) - /// Proof: `ParachainSystem::UpgradeRestrictionSignal` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingValidationCode` (r:1 w:1) - /// Proof: `ParachainSystem::PendingValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::NewValidationCode` (r:0 w:1) - /// Proof: `ParachainSystem::NewValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::DidSetValidationCode` (r:0 w:1) - /// Proof: `ParachainSystem::DidSetValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn set_code() -> Weight { - // Proof Size summary in bytes: - // Measured: `164` - // Estimated: `1649` - // Minimum execution time: 196_300_317_000 picoseconds. - Weight::from_parts(199_282_075_000, 0) - .saturating_add(Weight::from_parts(0, 1649)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `i` is `[0, 1000]`. - fn set_storage(i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_979_000 picoseconds. - Weight::from_parts(2_095_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_006 - .saturating_add(Weight::from_parts(802_213, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `i` is `[0, 1000]`. - fn kill_storage(i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_059_000 picoseconds. - Weight::from_parts(2_150_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 1_544 - .saturating_add(Weight::from_parts(622_926, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `p` is `[0, 1000]`. - fn kill_prefix(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `87 + p * (69 ±0)` - // Estimated: `77 + p * (70 ±0)` - // Minimum execution time: 4_114_000 picoseconds. - Weight::from_parts(4_276_000, 0) - .saturating_add(Weight::from_parts(0, 77)) - // Standard Error: 3_452 - .saturating_add(Weight::from_parts(1_507_698, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into())) - } - /// Storage: `System::AuthorizedUpgrade` (r:0 w:1) - /// Proof: `System::AuthorizedUpgrade` (`max_values`: Some(1), `max_size`: Some(33), added: 528, mode: `MaxEncodedLen`) - fn authorize_upgrade() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 19_331_000 picoseconds. - Weight::from_parts(22_273_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::AuthorizedUpgrade` (r:1 w:1) - /// Proof: `System::AuthorizedUpgrade` (`max_values`: Some(1), `max_size`: Some(33), added: 528, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) - /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpgradeRestrictionSignal` (r:1 w:0) - /// Proof: `ParachainSystem::UpgradeRestrictionSignal` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingValidationCode` (r:1 w:1) - /// Proof: `ParachainSystem::PendingValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::NewValidationCode` (r:0 w:1) - /// Proof: `ParachainSystem::NewValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::DidSetValidationCode` (r:0 w:1) - /// Proof: `ParachainSystem::DidSetValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn apply_authorized_upgrade() -> Weight { - // Proof Size summary in bytes: - // Measured: `186` - // Estimated: `1671` - // Minimum execution time: 201_945_687_000 picoseconds. - Weight::from_parts(205_896_056_000, 0) - .saturating_add(Weight::from_parts(0, 1671)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(4)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/frame_system_extensions.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/frame_system_extensions.rs deleted file mode 100644 index 2b4bbb426032a..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/frame_system_extensions.rs +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// This file is part of Cumulus. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `frame_system_extensions` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-12-21, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `gleipnir`, CPU: `AMD Ryzen 9 7900X 12-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("coretime-rococo-dev")`, DB CACHE: 1024 - -// Executed Command: -// ./target/release/polkadot-parachain -// benchmark -// pallet -// --wasm-execution=compiled -// --pallet=frame_system_extensions -// --no-storage-info -// --no-median-slopes -// --no-min-squares -// --extrinsic=* -// --steps=2 -// --repeat=2 -// --json -// --header=./cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/ -// --chain=coretime-rococo-dev - -#![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 `frame_system_extensions`. -pub struct WeightInfo(PhantomData); -impl frame_system::ExtensionsWeightInfo for WeightInfo { - /// Storage: `System::BlockHash` (r:1 w:0) - /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - fn check_genesis() -> Weight { - // Proof Size summary in bytes: - // Measured: `54` - // Estimated: `3509` - // Minimum execution time: 3_637_000 picoseconds. - Weight::from_parts(6_382_000, 0) - .saturating_add(Weight::from_parts(0, 3509)) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: `System::BlockHash` (r:1 w:0) - /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - fn check_mortality_mortal_transaction() -> Weight { - // Proof Size summary in bytes: - // Measured: `92` - // Estimated: `3509` - // Minimum execution time: 5_841_000 picoseconds. - Weight::from_parts(8_776_000, 0) - .saturating_add(Weight::from_parts(0, 3509)) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: `System::BlockHash` (r:1 w:0) - /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - fn check_mortality_immortal_transaction() -> Weight { - // Proof Size summary in bytes: - // Measured: `92` - // Estimated: `3509` - // Minimum execution time: 5_841_000 picoseconds. - Weight::from_parts(8_776_000, 0) - .saturating_add(Weight::from_parts(0, 3509)) - .saturating_add(T::DbWeight::get().reads(1)) - } - fn check_non_zero_sender() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 561_000 picoseconds. - Weight::from_parts(2_705_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn check_nonce() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_316_000 picoseconds. - Weight::from_parts(5_771_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn check_spec_version() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 511_000 picoseconds. - Weight::from_parts(2_575_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn check_tx_version() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 501_000 picoseconds. - Weight::from_parts(2_595_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `System::AllExtrinsicsLen` (r:1 w:1) - /// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `System::BlockWeight` (r:1 w:1) - /// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) - fn check_weight() -> Weight { - // Proof Size summary in bytes: - // Measured: `24` - // Estimated: `1533` - // Minimum execution time: 3_687_000 picoseconds. - Weight::from_parts(6_192_000, 0) - .saturating_add(Weight::from_parts(0, 1533)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `System::AllExtrinsicsLen` (r:1 w:1) - /// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `System::BlockWeight` (r:1 w:1) - /// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) - fn weight_reclaim() -> Weight { - // Proof Size summary in bytes: - // Measured: `24` - // Estimated: `1533` - // Minimum execution time: 3_687_000 picoseconds. - Weight::from_parts(6_192_000, 0) - .saturating_add(Weight::from_parts(0, 1533)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/mod.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/mod.rs deleted file mode 100644 index 7fee4a728b9ef..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/mod.rs +++ /dev/null @@ -1,44 +0,0 @@ -// This file is part of Cumulus. - -// Copyright (C) 2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Expose the auto generated weight files. - -pub mod block_weights; -pub mod cumulus_pallet_parachain_system; -pub mod cumulus_pallet_weight_reclaim; -pub mod cumulus_pallet_xcmp_queue; -pub mod extrinsic_weights; -pub mod frame_system; -pub mod frame_system_extensions; -pub mod pallet_balances; -pub mod pallet_broker; -pub mod pallet_collator_selection; -pub mod pallet_message_queue; -pub mod pallet_multisig; -pub mod pallet_proxy; -pub mod pallet_session; -pub mod pallet_timestamp; -pub mod pallet_transaction_payment; -pub mod pallet_utility; -pub mod pallet_xcm; -pub mod paritydb_weights; -pub mod rocksdb_weights; -pub mod xcm; - -pub use block_weights::constants::BlockExecutionWeight; -pub use extrinsic_weights::constants::ExtrinsicBaseWeight; -pub use rocksdb_weights::constants::RocksDbWeight; diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_balances.rs deleted file mode 100644 index 78bcf7d0821f6..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_balances.rs +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_balances` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `731f893ee36e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=pallet_balances -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_balances`. -pub struct WeightInfo(PhantomData); -impl pallet_balances::WeightInfo for WeightInfo { - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn transfer_allow_death() -> Weight { - // Proof Size summary in bytes: - // Measured: `52` - // Estimated: `3593` - // Minimum execution time: 55_154_000 picoseconds. - Weight::from_parts(57_138_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn transfer_keep_alive() -> Weight { - // Proof Size summary in bytes: - // Measured: `52` - // Estimated: `3593` - // Minimum execution time: 41_474_000 picoseconds. - Weight::from_parts(42_241_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn force_set_balance_creating() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `3593` - // Minimum execution time: 15_302_000 picoseconds. - Weight::from_parts(15_983_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn force_set_balance_killing() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `3593` - // Minimum execution time: 22_164_000 picoseconds. - Weight::from_parts(23_054_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn force_transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `155` - // Estimated: `6196` - // Minimum execution time: 53_719_000 picoseconds. - Weight::from_parts(54_410_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn transfer_all() -> Weight { - // Proof Size summary in bytes: - // Measured: `52` - // Estimated: `3593` - // Minimum execution time: 52_699_000 picoseconds. - Weight::from_parts(55_436_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn force_unreserve() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `3593` - // Minimum execution time: 17_575_000 picoseconds. - Weight::from_parts(18_203_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::Account` (r:999 w:999) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `u` is `[1, 1000]`. - fn upgrade_accounts(u: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0 + u * (136 ±0)` - // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 17_805_000 picoseconds. - Weight::from_parts(18_487_000, 0) - .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 23_150 - .saturating_add(Weight::from_parts(16_728_873, 0).saturating_mul(u.into())) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) - .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) - } - fn force_adjust_total_issuance() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_293_000 picoseconds. - Weight::from_parts(6_504_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn burn_allow_death() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 31_744_000 picoseconds. - Weight::from_parts(32_669_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn burn_keep_alive() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 21_905_000 picoseconds. - Weight::from_parts(22_867_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_broker.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_broker.rs deleted file mode 100644 index 5132691aaa54a..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_broker.rs +++ /dev/null @@ -1,650 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_broker` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `731f893ee36e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=pallet_broker -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_broker`. -pub struct WeightInfo(PhantomData); -impl pallet_broker::WeightInfo for WeightInfo { - /// Storage: `Broker::Configuration` (r:0 w:1) - /// Proof: `Broker::Configuration` (`max_values`: Some(1), `max_size`: Some(31), added: 526, mode: `MaxEncodedLen`) - fn configure() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_559_000 picoseconds. - Weight::from_parts(2_723_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::Reservations` (r:1 w:1) - /// Proof: `Broker::Reservations` (`max_values`: Some(1), `max_size`: Some(12021), added: 12516, mode: `MaxEncodedLen`) - fn reserve() -> Weight { - // Proof Size summary in bytes: - // Measured: `10888` - // Estimated: `13506` - // Minimum execution time: 25_270_000 picoseconds. - Weight::from_parts(28_036_000, 0) - .saturating_add(Weight::from_parts(0, 13506)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::Reservations` (r:1 w:1) - /// Proof: `Broker::Reservations` (`max_values`: Some(1), `max_size`: Some(12021), added: 12516, mode: `MaxEncodedLen`) - fn unreserve() -> Weight { - // Proof Size summary in bytes: - // Measured: `12090` - // Estimated: `13506` - // Minimum execution time: 25_774_000 picoseconds. - Weight::from_parts(26_297_000, 0) - .saturating_add(Weight::from_parts(0, 13506)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::Leases` (r:1 w:1) - /// Proof: `Broker::Leases` (`max_values`: Some(1), `max_size`: Some(401), added: 896, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) - /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) - /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn set_lease() -> Weight { - // Proof Size summary in bytes: - // Measured: `466` - // Estimated: `1951` - // Minimum execution time: 13_685_000 picoseconds. - Weight::from_parts(14_628_000, 0) - .saturating_add(Weight::from_parts(0, 1951)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::Leases` (r:1 w:1) - /// Proof: `Broker::Leases` (`max_values`: Some(1), `max_size`: Some(401), added: 896, mode: `MaxEncodedLen`) - fn remove_lease() -> Weight { - // Proof Size summary in bytes: - // Measured: `470` - // Estimated: `1886` - // Minimum execution time: 10_681_000 picoseconds. - Weight::from_parts(11_120_000, 0) - .saturating_add(Weight::from_parts(0, 1886)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::Configuration` (r:1 w:0) - /// Proof: `Broker::Configuration` (`max_values`: Some(1), `max_size`: Some(31), added: 526, mode: `MaxEncodedLen`) - /// Storage: `Broker::Leases` (r:1 w:1) - /// Proof: `Broker::Leases` (`max_values`: Some(1), `max_size`: Some(401), added: 896, mode: `MaxEncodedLen`) - /// Storage: `Broker::Reservations` (r:1 w:0) - /// Proof: `Broker::Reservations` (`max_values`: Some(1), `max_size`: Some(12021), added: 12516, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) - /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) - /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Broker::InstaPoolIo` (r:3 w:3) - /// Proof: `Broker::InstaPoolIo` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `Broker::AutoRenewals` (r:1 w:1) - /// Proof: `Broker::AutoRenewals` (`max_values`: Some(1), `max_size`: Some(1002), added: 1497, mode: `MaxEncodedLen`) - /// Storage: `Broker::SaleInfo` (r:0 w:1) - /// Proof: `Broker::SaleInfo` (`max_values`: Some(1), `max_size`: Some(57), added: 552, mode: `MaxEncodedLen`) - /// Storage: `Broker::Status` (r:0 w:1) - /// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`) - /// Storage: `Broker::Workplan` (r:0 w:60) - /// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) - /// The range of component `n` is `[0, 1000]`. - fn start_sales(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `12567` - // Estimated: `15033 + n * (1 ±0)` - // Minimum execution time: 51_814_000 picoseconds. - Weight::from_parts(150_721_297, 0) - .saturating_add(Weight::from_parts(0, 15033)) - // Standard Error: 2_705 - .saturating_add(Weight::from_parts(20_778, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(12)) - .saturating_add(T::DbWeight::get().writes(59)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) - } - /// Storage: `Broker::Status` (r:1 w:0) - /// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`) - /// Storage: `Broker::SaleInfo` (r:1 w:1) - /// Proof: `Broker::SaleInfo` (`max_values`: Some(1), `max_size`: Some(57), added: 552, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) - /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Broker::Regions` (r:0 w:1) - /// Proof: `Broker::Regions` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - fn purchase() -> Weight { - // Proof Size summary in bytes: - // Measured: `437` - // Estimated: `3593` - // Minimum execution time: 64_403_000 picoseconds. - Weight::from_parts(69_856_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Broker::Configuration` (r:1 w:0) - /// Proof: `Broker::Configuration` (`max_values`: Some(1), `max_size`: Some(31), added: 526, mode: `MaxEncodedLen`) - /// Storage: `Broker::Status` (r:1 w:0) - /// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`) - /// Storage: `Broker::SaleInfo` (r:1 w:1) - /// Proof: `Broker::SaleInfo` (`max_values`: Some(1), `max_size`: Some(57), added: 552, mode: `MaxEncodedLen`) - /// Storage: `Broker::PotentialRenewals` (r:1 w:2) - /// Proof: `Broker::PotentialRenewals` (`max_values`: None, `max_size`: Some(1233), added: 3708, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) - /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Broker::Workplan` (r:0 w:1) - /// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) - fn renew() -> Weight { - // Proof Size summary in bytes: - // Measured: `658` - // Estimated: `4698` - // Minimum execution time: 117_679_000 picoseconds. - Weight::from_parts(131_097_000, 0) - .saturating_add(Weight::from_parts(0, 4698)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(5)) - } - /// Storage: `Broker::Regions` (r:1 w:1) - /// Proof: `Broker::Regions` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - fn transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `358` - // Estimated: `3551` - // Minimum execution time: 21_875_000 picoseconds. - Weight::from_parts(23_688_000, 0) - .saturating_add(Weight::from_parts(0, 3551)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::Regions` (r:1 w:2) - /// Proof: `Broker::Regions` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - fn partition() -> Weight { - // Proof Size summary in bytes: - // Measured: `358` - // Estimated: `3551` - // Minimum execution time: 23_879_000 picoseconds. - Weight::from_parts(25_354_000, 0) - .saturating_add(Weight::from_parts(0, 3551)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Broker::Regions` (r:1 w:3) - /// Proof: `Broker::Regions` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - fn interlace() -> Weight { - // Proof Size summary in bytes: - // Measured: `358` - // Estimated: `3551` - // Minimum execution time: 25_199_000 picoseconds. - Weight::from_parts(29_209_000, 0) - .saturating_add(Weight::from_parts(0, 3551)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Broker::Configuration` (r:1 w:0) - /// Proof: `Broker::Configuration` (`max_values`: Some(1), `max_size`: Some(31), added: 526, mode: `MaxEncodedLen`) - /// Storage: `Broker::Status` (r:1 w:0) - /// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`) - /// Storage: `Broker::Regions` (r:1 w:1) - /// Proof: `Broker::Regions` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - /// Storage: `Broker::Workplan` (r:1 w:1) - /// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) - fn assign() -> Weight { - // Proof Size summary in bytes: - // Measured: `937` - // Estimated: `4681` - // Minimum execution time: 38_377_000 picoseconds. - Weight::from_parts(41_124_000, 0) - .saturating_add(Weight::from_parts(0, 4681)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Broker::Status` (r:1 w:0) - /// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`) - /// Storage: `Broker::Regions` (r:1 w:1) - /// Proof: `Broker::Regions` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - /// Storage: `Broker::Workplan` (r:1 w:1) - /// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) - /// Storage: `Broker::InstaPoolIo` (r:2 w:2) - /// Proof: `Broker::InstaPoolIo` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `Broker::InstaPoolContribution` (r:0 w:1) - /// Proof: `Broker::InstaPoolContribution` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) - fn pool() -> Weight { - // Proof Size summary in bytes: - // Measured: `1003` - // Estimated: `5996` - // Minimum execution time: 45_084_000 picoseconds. - Weight::from_parts(46_851_000, 0) - .saturating_add(Weight::from_parts(0, 5996)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(5)) - } - /// Storage: `Broker::InstaPoolContribution` (r:1 w:1) - /// Proof: `Broker::InstaPoolContribution` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) - /// Storage: `Broker::InstaPoolHistory` (r:3 w:1) - /// Proof: `Broker::InstaPoolHistory` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `m` is `[1, 3]`. - fn claim_revenue(m: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `671` - // Estimated: `6196 + m * (2520 ±0)` - // Minimum execution time: 72_975_000 picoseconds. - Weight::from_parts(76_716_241, 0) - .saturating_add(Weight::from_parts(0, 6196)) - // Standard Error: 159_873 - .saturating_add(Weight::from_parts(1_699_650, 0).saturating_mul(m.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into()))) - .saturating_add(T::DbWeight::get().writes(5)) - .saturating_add(Weight::from_parts(0, 2520).saturating_mul(m.into())) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn purchase_credit() -> Weight { - // Proof Size summary in bytes: - // Measured: `261` - // Estimated: `3726` - // Minimum execution time: 73_412_000 picoseconds. - Weight::from_parts(77_554_000, 0) - .saturating_add(Weight::from_parts(0, 3726)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Broker::Status` (r:1 w:0) - /// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`) - /// Storage: `Broker::Regions` (r:1 w:1) - /// Proof: `Broker::Regions` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - fn drop_region() -> Weight { - // Proof Size summary in bytes: - // Measured: `466` - // Estimated: `3551` - // Minimum execution time: 62_820_000 picoseconds. - Weight::from_parts(85_149_000, 0) - .saturating_add(Weight::from_parts(0, 3551)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::Configuration` (r:1 w:0) - /// Proof: `Broker::Configuration` (`max_values`: Some(1), `max_size`: Some(31), added: 526, mode: `MaxEncodedLen`) - /// Storage: `Broker::Status` (r:1 w:0) - /// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`) - /// Storage: `Broker::InstaPoolContribution` (r:1 w:1) - /// Proof: `Broker::InstaPoolContribution` (`max_values`: None, `max_size`: Some(68), added: 2543, mode: `MaxEncodedLen`) - fn drop_contribution() -> Weight { - // Proof Size summary in bytes: - // Measured: `463` - // Estimated: `3533` - // Minimum execution time: 104_501_000 picoseconds. - Weight::from_parts(146_124_000, 0) - .saturating_add(Weight::from_parts(0, 3533)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::Configuration` (r:1 w:0) - /// Proof: `Broker::Configuration` (`max_values`: Some(1), `max_size`: Some(31), added: 526, mode: `MaxEncodedLen`) - /// Storage: `Broker::Status` (r:1 w:0) - /// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`) - /// Storage: `Broker::InstaPoolHistory` (r:1 w:1) - /// Proof: `Broker::InstaPoolHistory` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn drop_history() -> Weight { - // Proof Size summary in bytes: - // Measured: `979` - // Estimated: `3593` - // Minimum execution time: 132_420_000 picoseconds. - Weight::from_parts(176_072_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::Status` (r:1 w:0) - /// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`) - /// Storage: `Broker::PotentialRenewals` (r:1 w:1) - /// Proof: `Broker::PotentialRenewals` (`max_values`: None, `max_size`: Some(1233), added: 3708, mode: `MaxEncodedLen`) - fn drop_renewal() -> Weight { - // Proof Size summary in bytes: - // Measured: `957` - // Estimated: `4698` - // Minimum execution time: 67_350_000 picoseconds. - Weight::from_parts(84_436_000, 0) - .saturating_add(Weight::from_parts(0, 4698)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 1000]`. - fn request_core_count(_n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `3507` - // Minimum execution time: 21_143_000 picoseconds. - Weight::from_parts(22_691_546, 0) - .saturating_add(Weight::from_parts(0, 3507)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::CoreCountInbox` (r:1 w:1) - /// Proof: `Broker::CoreCountInbox` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`) - /// The range of component `n` is `[0, 1000]`. - fn process_core_count(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `266` - // Estimated: `1487` - // Minimum execution time: 7_972_000 picoseconds. - Weight::from_parts(8_929_699, 0) - .saturating_add(Weight::from_parts(0, 1487)) - // Standard Error: 44 - .saturating_add(Weight::from_parts(145, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::RevenueInbox` (r:1 w:1) - /// Proof: `Broker::RevenueInbox` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) - /// Storage: `Broker::InstaPoolHistory` (r:1 w:1) - /// Proof: `Broker::InstaPoolHistory` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn process_revenue() -> Weight { - // Proof Size summary in bytes: - // Measured: `461` - // Estimated: `6196` - // Minimum execution time: 58_860_000 picoseconds. - Weight::from_parts(63_100_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) - /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Broker::InstaPoolIo` (r:3 w:3) - /// Proof: `Broker::InstaPoolIo` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `Broker::Reservations` (r:1 w:0) - /// Proof: `Broker::Reservations` (`max_values`: Some(1), `max_size`: Some(12021), added: 12516, mode: `MaxEncodedLen`) - /// Storage: `Broker::Leases` (r:1 w:1) - /// Proof: `Broker::Leases` (`max_values`: Some(1), `max_size`: Some(401), added: 896, mode: `MaxEncodedLen`) - /// Storage: `Broker::AutoRenewals` (r:1 w:1) - /// Proof: `Broker::AutoRenewals` (`max_values`: Some(1), `max_size`: Some(1002), added: 1497, mode: `MaxEncodedLen`) - /// Storage: `Broker::Configuration` (r:1 w:0) - /// Proof: `Broker::Configuration` (`max_values`: Some(1), `max_size`: Some(31), added: 526, mode: `MaxEncodedLen`) - /// Storage: `Broker::Status` (r:1 w:0) - /// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`) - /// Storage: `Broker::PotentialRenewals` (r:100 w:200) - /// Proof: `Broker::PotentialRenewals` (`max_values`: None, `max_size`: Some(1233), added: 3708, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:101 w:101) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Broker::SaleInfo` (r:0 w:1) - /// Proof: `Broker::SaleInfo` (`max_values`: Some(1), `max_size`: Some(57), added: 552, mode: `MaxEncodedLen`) - /// Storage: `Broker::Workplan` (r:0 w:1000) - /// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) - /// The range of component `n` is `[0, 1000]`. - fn rotate_sale(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `32497` - // Estimated: `233641 + n * (198 ±9)` - // Minimum execution time: 32_268_000 picoseconds. - Weight::from_parts(2_840_705_550, 0) - .saturating_add(Weight::from_parts(0, 233641)) - // Standard Error: 173_120 - .saturating_add(Weight::from_parts(4_374_189, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(126)) - .saturating_add(T::DbWeight::get().writes(181)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 198).saturating_mul(n.into())) - } - /// Storage: `Broker::InstaPoolIo` (r:1 w:0) - /// Proof: `Broker::InstaPoolIo` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `Broker::InstaPoolHistory` (r:0 w:1) - /// Proof: `Broker::InstaPoolHistory` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `MaxEncodedLen`) - fn process_pool() -> Weight { - // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `3493` - // Minimum execution time: 7_959_000 picoseconds. - Weight::from_parts(8_480_000, 0) - .saturating_add(Weight::from_parts(0, 3493)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::Workplan` (r:1 w:1) - /// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) - /// Storage: `Broker::Workload` (r:1 w:1) - /// Proof: `Broker::Workload` (`max_values`: None, `max_size`: Some(1212), added: 3687, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn process_core_schedule() -> Weight { - // Proof Size summary in bytes: - // Measured: `1289` - // Estimated: `4754` - // Minimum execution time: 32_507_000 picoseconds. - Weight::from_parts(33_752_000, 0) - .saturating_add(Weight::from_parts(0, 4754)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn request_revenue_info_at() -> Weight { - // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `3507` - // Minimum execution time: 16_470_000 picoseconds. - Weight::from_parts(17_120_000, 0) - .saturating_add(Weight::from_parts(0, 3507)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::CoreCountInbox` (r:0 w:1) - /// Proof: `Broker::CoreCountInbox` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`) - fn notify_core_count() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_503_000 picoseconds. - Weight::from_parts(2_674_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::RevenueInbox` (r:0 w:1) - /// Proof: `Broker::RevenueInbox` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) - fn notify_revenue() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_519_000 picoseconds. - Weight::from_parts(2_752_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::Status` (r:1 w:1) - /// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`) - /// Storage: `Broker::Configuration` (r:1 w:0) - /// Proof: `Broker::Configuration` (`max_values`: Some(1), `max_size`: Some(31), added: 526, mode: `MaxEncodedLen`) - /// Storage: `Broker::CoreCountInbox` (r:1 w:0) - /// Proof: `Broker::CoreCountInbox` (`max_values`: Some(1), `max_size`: Some(2), added: 497, mode: `MaxEncodedLen`) - /// Storage: `Broker::RevenueInbox` (r:1 w:0) - /// Proof: `Broker::RevenueInbox` (`max_values`: Some(1), `max_size`: Some(20), added: 515, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) - /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn do_tick_base() -> Weight { - // Proof Size summary in bytes: - // Measured: `408` - // Estimated: `1893` - // Minimum execution time: 14_229_000 picoseconds. - Weight::from_parts(15_177_000, 0) - .saturating_add(Weight::from_parts(0, 1893)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::SaleInfo` (r:1 w:0) - /// Proof: `Broker::SaleInfo` (`max_values`: Some(1), `max_size`: Some(57), added: 552, mode: `MaxEncodedLen`) - /// Storage: `Broker::Reservations` (r:1 w:1) - /// Proof: `Broker::Reservations` (`max_values`: Some(1), `max_size`: Some(12021), added: 12516, mode: `MaxEncodedLen`) - /// Storage: `Broker::Status` (r:1 w:0) - /// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`) - /// Storage: `Broker::Workplan` (r:0 w:2) - /// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) - fn force_reserve() -> Weight { - // Proof Size summary in bytes: - // Measured: `11141` - // Estimated: `13506` - // Minimum execution time: 43_203_000 picoseconds. - Weight::from_parts(45_670_000, 0) - .saturating_add(Weight::from_parts(0, 13506)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Broker::Leases` (r:1 w:1) - /// Proof: `Broker::Leases` (`max_values`: Some(1), `max_size`: Some(401), added: 896, mode: `MaxEncodedLen`) - fn swap_leases() -> Weight { - // Proof Size summary in bytes: - // Measured: `470` - // Estimated: `1886` - // Minimum execution time: 7_773_000 picoseconds. - Weight::from_parts(8_304_000, 0) - .saturating_add(Weight::from_parts(0, 1886)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Broker::SaleInfo` (r:1 w:1) - /// Proof: `Broker::SaleInfo` (`max_values`: Some(1), `max_size`: Some(57), added: 552, mode: `MaxEncodedLen`) - /// Storage: `Broker::PotentialRenewals` (r:1 w:2) - /// Proof: `Broker::PotentialRenewals` (`max_values`: None, `max_size`: Some(1233), added: 3708, mode: `MaxEncodedLen`) - /// Storage: `Broker::Configuration` (r:1 w:0) - /// Proof: `Broker::Configuration` (`max_values`: Some(1), `max_size`: Some(31), added: 526, mode: `MaxEncodedLen`) - /// Storage: `Broker::Status` (r:1 w:0) - /// Proof: `Broker::Status` (`max_values`: Some(1), `max_size`: Some(18), added: 513, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) - /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Broker::AutoRenewals` (r:1 w:1) - /// Proof: `Broker::AutoRenewals` (`max_values`: Some(1), `max_size`: Some(1002), added: 1497, mode: `MaxEncodedLen`) - /// Storage: `Broker::Workplan` (r:0 w:1) - /// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) - fn enable_auto_renew() -> Weight { - // Proof Size summary in bytes: - // Measured: `2829` - // Estimated: `6196` - // Minimum execution time: 159_458_000 picoseconds. - Weight::from_parts(174_911_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(7)) - } - /// Storage: `Broker::AutoRenewals` (r:1 w:1) - /// Proof: `Broker::AutoRenewals` (`max_values`: Some(1), `max_size`: Some(1002), added: 1497, mode: `MaxEncodedLen`) - fn disable_auto_renew() -> Weight { - // Proof Size summary in bytes: - // Measured: `1307` - // Estimated: `2487` - // Minimum execution time: 31_994_000 picoseconds. - Weight::from_parts(41_143_000, 0) - .saturating_add(Weight::from_parts(0, 2487)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1) - /// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn on_new_timeslice() -> Weight { - // Proof Size summary in bytes: - // Measured: `261` - // Estimated: `3726` - // Minimum execution time: 59_280_000 picoseconds. - Weight::from_parts(62_361_000, 0) - .saturating_add(Weight::from_parts(0, 3726)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Broker::Workplan` (r:1 w:1) - /// Proof: `Broker::Workplan` (`max_values`: None, `max_size`: Some(1216), added: 3691, mode: `MaxEncodedLen`) - fn remove_assignment() -> Weight { - // Proof Size summary in bytes: - // Measured: `798` - // Estimated: `4681` - // Minimum execution time: 23_100_000 picoseconds. - Weight::from_parts(24_235_000, 0) - .saturating_add(Weight::from_parts(0, 4681)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_collator_selection.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_collator_selection.rs deleted file mode 100644 index 7c67136f707c3..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_collator_selection.rs +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_collator_selection` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `731f893ee36e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=pallet_collator_selection -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_collator_selection`. -pub struct WeightInfo(PhantomData); -impl pallet_collator_selection::WeightInfo for WeightInfo { - /// Storage: `Session::NextKeys` (r:20 w:0) - /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `CollatorSelection::Invulnerables` (r:0 w:1) - /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// The range of component `b` is `[1, 20]`. - fn set_invulnerables(b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `164 + b * (79 ±0)` - // Estimated: `1155 + b * (2555 ±0)` - // Minimum execution time: 13_048_000 picoseconds. - Weight::from_parts(11_304_712, 0) - .saturating_add(Weight::from_parts(0, 1155)) - // Standard Error: 21_915 - .saturating_add(Weight::from_parts(4_267_551, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(Weight::from_parts(0, 2555).saturating_mul(b.into())) - } - /// Storage: `Session::NextKeys` (r:1 w:0) - /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `CollatorSelection::Invulnerables` (r:1 w:1) - /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::CandidateList` (r:1 w:1) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `b` is `[1, 19]`. - /// The range of component `c` is `[1, 99]`. - fn add_invulnerable(b: u32, c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `758 + b * (32 ±0) + c * (53 ±0)` - // Estimated: `6287 + b * (37 ±0) + c * (53 ±0)` - // Minimum execution time: 49_420_000 picoseconds. - Weight::from_parts(52_550_161, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 24_099 - .saturating_add(Weight::from_parts(43_362, 0).saturating_mul(b.into())) - // Standard Error: 4_568 - .saturating_add(Weight::from_parts(309_696, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 37).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 53).saturating_mul(c.into())) - } - /// Storage: `CollatorSelection::CandidateList` (r:1 w:0) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::Invulnerables` (r:1 w:1) - /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// The range of component `b` is `[5, 20]`. - fn remove_invulnerable(b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `119 + b * (32 ±0)` - // Estimated: `6287` - // Minimum execution time: 12_963_000 picoseconds. - Weight::from_parts(13_242_864, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 4_777 - .saturating_add(Weight::from_parts(181_470, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `CollatorSelection::DesiredCandidates` (r:0 w:1) - /// Proof: `CollatorSelection::DesiredCandidates` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - fn set_desired_candidates() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_262_000 picoseconds. - Weight::from_parts(5_533_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `CollatorSelection::CandidacyBond` (r:1 w:1) - /// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::CandidateList` (r:1 w:1) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:100 w:100) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:100) - /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - /// The range of component `c` is `[0, 100]`. - /// The range of component `k` is `[0, 100]`. - fn set_candidacy_bond(c: u32, k: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0 + c * (181 ±0) + k * (113 ±0)` - // Estimated: `6287 + c * (901 ±29) + k * (901 ±29)` - // Minimum execution time: 11_318_000 picoseconds. - Weight::from_parts(11_646_000, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 190_086 - .saturating_add(Weight::from_parts(6_597_738, 0).saturating_mul(c.into())) - // Standard Error: 190_086 - .saturating_add(Weight::from_parts(5_920_183, 0).saturating_mul(k.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) - .saturating_add(Weight::from_parts(0, 901).saturating_mul(c.into())) - .saturating_add(Weight::from_parts(0, 901).saturating_mul(k.into())) - } - /// Storage: `CollatorSelection::CandidacyBond` (r:1 w:0) - /// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::CandidateList` (r:1 w:1) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// The range of component `c` is `[4, 100]`. - fn update_bond(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `295 + c * (49 ±0)` - // Estimated: `6287` - // Minimum execution time: 29_899_000 picoseconds. - Weight::from_parts(32_104_137, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 3_628 - .saturating_add(Weight::from_parts(265_696, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `CollatorSelection::CandidateList` (r:1 w:1) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::Invulnerables` (r:1 w:0) - /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// Storage: `Session::NextKeys` (r:1 w:0) - /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `CollatorSelection::CandidacyBond` (r:1 w:0) - /// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1) - /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - /// The range of component `c` is `[1, 99]`. - fn register_as_candidate(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `724 + c * (52 ±0)` - // Estimated: `6287 + c * (54 ±0)` - // Minimum execution time: 43_410_000 picoseconds. - Weight::from_parts(47_711_493, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 4_289 - .saturating_add(Weight::from_parts(336_017, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(Weight::from_parts(0, 54).saturating_mul(c.into())) - } - /// Storage: `CollatorSelection::Invulnerables` (r:1 w:0) - /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::CandidacyBond` (r:1 w:0) - /// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - /// Storage: `Session::NextKeys` (r:1 w:0) - /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `CollatorSelection::CandidateList` (r:1 w:1) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:2) - /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - /// The range of component `c` is `[4, 100]`. - fn take_candidate_slot(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `892 + c * (52 ±0)` - // Estimated: `6287 + c * (55 ±0)` - // Minimum execution time: 61_616_000 picoseconds. - Weight::from_parts(67_366_335, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 6_183 - .saturating_add(Weight::from_parts(350_711, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(4)) - .saturating_add(Weight::from_parts(0, 55).saturating_mul(c.into())) - } - /// Storage: `CollatorSelection::CandidateList` (r:1 w:1) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::Invulnerables` (r:1 w:0) - /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1) - /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - /// The range of component `c` is `[4, 100]`. - fn leave_intent(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `314 + c * (48 ±0)` - // Estimated: `6287` - // Minimum execution time: 32_929_000 picoseconds. - Weight::from_parts(35_028_430, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 3_778 - .saturating_add(Weight::from_parts(285_010, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1) - /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - fn note_author() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `6196` - // Minimum execution time: 43_473_000 picoseconds. - Weight::from_parts(44_091_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `CollatorSelection::CandidateList` (r:1 w:0) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::LastAuthoredBlock` (r:100 w:0) - /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::Invulnerables` (r:1 w:0) - /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::DesiredCandidates` (r:1 w:0) - /// Proof: `CollatorSelection::DesiredCandidates` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:97 w:97) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `r` is `[1, 100]`. - /// The range of component `c` is `[1, 100]`. - fn new_session(r: u32, c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `2146 + c * (97 ±0) + r * (113 ±0)` - // Estimated: `6287 + c * (2519 ±0) + r * (2603 ±0)` - // Minimum execution time: 20_505_000 picoseconds. - Weight::from_parts(20_920_000, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 341_718 - .saturating_add(Weight::from_parts(15_760_613, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 2519).saturating_mul(c.into())) - .saturating_add(Weight::from_parts(0, 2603).saturating_mul(r.into())) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_message_queue.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_message_queue.rs deleted file mode 100644 index 29171099ffef5..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_message_queue.rs +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_message_queue` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `731f893ee36e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=pallet_message_queue -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_message_queue`. -pub struct WeightInfo(PhantomData); -impl pallet_message_queue::WeightInfo for WeightInfo { - /// Storage: `MessageQueue::ServiceHead` (r:1 w:0) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::BookStateFor` (r:2 w:2) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - fn ready_ring_knit() -> Weight { - // Proof Size summary in bytes: - // Measured: `223` - // Estimated: `6044` - // Minimum execution time: 14_405_000 picoseconds. - Weight::from_parts(14_797_000, 0) - .saturating_add(Weight::from_parts(0, 6044)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `MessageQueue::BookStateFor` (r:2 w:2) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - fn ready_ring_unknit() -> Weight { - // Proof Size summary in bytes: - // Measured: `218` - // Estimated: `6044` - // Minimum execution time: 12_706_000 picoseconds. - Weight::from_parts(13_539_000, 0) - .saturating_add(Weight::from_parts(0, 6044)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - fn service_queue_base() -> Weight { - // Proof Size summary in bytes: - // Measured: `6` - // Estimated: `3517` - // Minimum execution time: 4_090_000 picoseconds. - Weight::from_parts(4_371_000, 0) - .saturating_add(Weight::from_parts(0, 3517)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `MessageQueue::Pages` (r:1 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn service_page_base_completion() -> Weight { - // Proof Size summary in bytes: - // Measured: `72` - // Estimated: `108986` - // Minimum execution time: 6_532_000 picoseconds. - Weight::from_parts(6_800_000, 0) - .saturating_add(Weight::from_parts(0, 108986)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `MessageQueue::Pages` (r:1 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn service_page_base_no_completion() -> Weight { - // Proof Size summary in bytes: - // Measured: `72` - // Estimated: `108986` - // Minimum execution time: 6_433_000 picoseconds. - Weight::from_parts(6_801_000, 0) - .saturating_add(Weight::from_parts(0, 108986)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `MessageQueue::BookStateFor` (r:0 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:0 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn service_page_item() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 308_978_000 picoseconds. - Weight::from_parts(320_864_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:0) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - fn bump_service_head() -> Weight { - // Proof Size summary in bytes: - // Measured: `171` - // Estimated: `3517` - // Minimum execution time: 7_742_000 picoseconds. - Weight::from_parts(8_240_000, 0) - .saturating_add(Weight::from_parts(0, 3517)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `MessageQueue::BookStateFor` (r:1 w:0) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:0 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - fn set_service_head() -> Weight { - // Proof Size summary in bytes: - // Measured: `161` - // Estimated: `3517` - // Minimum execution time: 6_237_000 picoseconds. - Weight::from_parts(6_609_000, 0) - .saturating_add(Weight::from_parts(0, 3517)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:1 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn reap_page() -> Weight { - // Proof Size summary in bytes: - // Measured: `105609` - // Estimated: `108986` - // Minimum execution time: 128_314_000 picoseconds. - Weight::from_parts(135_492_000, 0) - .saturating_add(Weight::from_parts(0, 108986)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:1 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn execute_overweight_page_removed() -> Weight { - // Proof Size summary in bytes: - // Measured: `105609` - // Estimated: `108986` - // Minimum execution time: 160_479_000 picoseconds. - Weight::from_parts(171_099_000, 0) - .saturating_add(Weight::from_parts(0, 108986)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:1 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn execute_overweight_page_updated() -> Weight { - // Proof Size summary in bytes: - // Measured: `105609` - // Estimated: `108986` - // Minimum execution time: 225_101_000 picoseconds. - Weight::from_parts(245_361_000, 0) - .saturating_add(Weight::from_parts(0, 108986)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_multisig.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_multisig.rs deleted file mode 100644 index 441b4e625dd8c..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_multisig.rs +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_multisig` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `c8c7296f7413`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=pallet_multisig -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_multisig`. -pub struct WeightInfo(PhantomData); -impl pallet_multisig::WeightInfo for WeightInfo { - /// The range of component `z` is `[0, 10000]`. - fn as_multi_threshold_1(z: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 15_641_000 picoseconds. - Weight::from_parts(16_253_264, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 9 - .saturating_add(Weight::from_parts(490, 0).saturating_mul(z.into())) - } - /// Storage: `Multisig::Multisigs` (r:1 w:1) - /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) - /// The range of component `s` is `[2, 100]`. - /// The range of component `z` is `[0, 10000]`. - fn as_multi_create(s: u32, z: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `262 + s * (2 ±0)` - // Estimated: `6811` - // Minimum execution time: 45_641_000 picoseconds. - Weight::from_parts(32_463_659, 0) - .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 1_746 - .saturating_add(Weight::from_parts(154_624, 0).saturating_mul(s.into())) - // Standard Error: 17 - .saturating_add(Weight::from_parts(1_972, 0).saturating_mul(z.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Multisig::Multisigs` (r:1 w:1) - /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) - /// The range of component `s` is `[3, 100]`. - /// The range of component `z` is `[0, 10000]`. - fn as_multi_approve(s: u32, z: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `282` - // Estimated: `6811` - // Minimum execution time: 30_242_000 picoseconds. - Weight::from_parts(18_657_028, 0) - .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 1_726 - .saturating_add(Weight::from_parts(135_426, 0).saturating_mul(s.into())) - // Standard Error: 16 - .saturating_add(Weight::from_parts(1_960, 0).saturating_mul(z.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Multisig::Multisigs` (r:1 w:1) - /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `s` is `[2, 100]`. - /// The range of component `z` is `[0, 10000]`. - fn as_multi_complete(s: u32, z: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `385 + s * (33 ±0)` - // Estimated: `6811` - // Minimum execution time: 52_084_000 picoseconds. - Weight::from_parts(32_454_224, 0) - .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 2_509 - .saturating_add(Weight::from_parts(214_513, 0).saturating_mul(s.into())) - // Standard Error: 24 - .saturating_add(Weight::from_parts(2_247, 0).saturating_mul(z.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Multisig::Multisigs` (r:1 w:1) - /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) - /// The range of component `s` is `[2, 100]`. - fn approve_as_multi_create(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `263 + s * (2 ±0)` - // Estimated: `6811` - // Minimum execution time: 29_600_000 picoseconds. - Weight::from_parts(30_597_949, 0) - .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 2_117 - .saturating_add(Weight::from_parts(191_486, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Multisig::Multisigs` (r:1 w:1) - /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) - /// The range of component `s` is `[2, 100]`. - fn approve_as_multi_approve(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `282` - // Estimated: `6811` - // Minimum execution time: 17_839_000 picoseconds. - Weight::from_parts(18_672_161, 0) - .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 2_491 - .saturating_add(Weight::from_parts(172_942, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Multisig::Multisigs` (r:1 w:1) - /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) - /// The range of component `s` is `[2, 100]`. - fn cancel_as_multi(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `454 + s * (1 ±0)` - // Estimated: `6811` - // Minimum execution time: 31_824_000 picoseconds. - Weight::from_parts(35_736_587, 0) - .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 3_833 - .saturating_add(Weight::from_parts(187_839, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Multisig::Multisigs` (r:1 w:1) - /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) - /// The range of component `s` is `[2, 100]`. - fn poke_deposit(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `454 + s * (1 ±0)` - // Estimated: `6811` - // Minimum execution time: 29_796_000 picoseconds. - Weight::from_parts(35_859_134, 0) - .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 3_720 - .saturating_add(Weight::from_parts(82_222, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_proxy.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_proxy.rs deleted file mode 100644 index c0fd7f312191d..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_proxy.rs +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_proxy` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-03-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `99fc4dfa9c86`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=pallet_proxy -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_proxy`. -pub struct WeightInfo(PhantomData); -impl pallet_proxy::WeightInfo for WeightInfo { - /// Storage: `Proxy::Proxies` (r:1 w:0) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// The range of component `p` is `[1, 31]`. - fn proxy(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `127 + p * (37 ±0)` - // Estimated: `4706` - // Minimum execution time: 13_890_000 picoseconds. - Weight::from_parts(14_690_357, 0) - .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_079 - .saturating_add(Weight::from_parts(35_620, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: `Proxy::Proxies` (r:1 w:0) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// Storage: `Proxy::Announcements` (r:1 w:1) - /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `a` is `[0, 31]`. - /// The range of component `p` is `[1, 31]`. - fn proxy_announced(a: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `454 + a * (68 ±0) + p * (37 ±0)` - // Estimated: `5698` - // Minimum execution time: 40_937_000 picoseconds. - Weight::from_parts(41_413_996, 0) - .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 2_304 - .saturating_add(Weight::from_parts(151_878, 0).saturating_mul(a.into())) - // Standard Error: 2_380 - .saturating_add(Weight::from_parts(49_552, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Proxy::Announcements` (r:1 w:1) - /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `a` is `[0, 31]`. - /// The range of component `p` is `[1, 31]`. - fn remove_announcement(a: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `369 + a * (68 ±0)` - // Estimated: `5698` - // Minimum execution time: 25_502_000 picoseconds. - Weight::from_parts(26_072_967, 0) - .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_715 - .saturating_add(Weight::from_parts(150_032, 0).saturating_mul(a.into())) - // Standard Error: 1_772 - .saturating_add(Weight::from_parts(27_530, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Proxy::Announcements` (r:1 w:1) - /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `a` is `[0, 31]`. - /// The range of component `p` is `[1, 31]`. - fn reject_announcement(a: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `369 + a * (68 ±0)` - // Estimated: `5698` - // Minimum execution time: 25_381_000 picoseconds. - Weight::from_parts(25_796_690, 0) - .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_798 - .saturating_add(Weight::from_parts(155_598, 0).saturating_mul(a.into())) - // Standard Error: 1_858 - .saturating_add(Weight::from_parts(31_967, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Proxy::Proxies` (r:1 w:0) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// Storage: `Proxy::Announcements` (r:1 w:1) - /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `a` is `[0, 31]`. - /// The range of component `p` is `[1, 31]`. - fn announce(a: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `386 + a * (68 ±0) + p * (37 ±0)` - // Estimated: `5698` - // Minimum execution time: 33_900_000 picoseconds. - Weight::from_parts(37_483_729, 0) - .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 3_283 - .saturating_add(Weight::from_parts(166_328, 0).saturating_mul(a.into())) - // Standard Error: 3_392 - .saturating_add(Weight::from_parts(48_909, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Proxy::Proxies` (r:1 w:1) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// The range of component `p` is `[1, 31]`. - fn add_proxy(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `127 + p * (37 ±0)` - // Estimated: `4706` - // Minimum execution time: 24_003_000 picoseconds. - Weight::from_parts(24_851_370, 0) - .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_101 - .saturating_add(Weight::from_parts(51_924, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Proxy::Proxies` (r:1 w:1) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// The range of component `p` is `[1, 31]`. - fn remove_proxy(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `127 + p * (37 ±0)` - // Estimated: `4706` - // Minimum execution time: 23_865_000 picoseconds. - Weight::from_parts(24_891_590, 0) - .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_213 - .saturating_add(Weight::from_parts(51_884, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Proxy::Proxies` (r:1 w:1) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// The range of component `p` is `[1, 31]`. - fn remove_proxies(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `127 + p * (37 ±0)` - // Estimated: `4706` - // Minimum execution time: 21_419_000 picoseconds. - Weight::from_parts(22_277_152, 0) - .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_286 - .saturating_add(Weight::from_parts(32_631, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Proxy::Proxies` (r:1 w:1) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// The range of component `p` is `[1, 31]`. - fn create_pure(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `4706` - // Minimum execution time: 25_635_000 picoseconds. - Weight::from_parts(26_592_871, 0) - .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_635 - .saturating_add(Weight::from_parts(22_103, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Proxy::Proxies` (r:1 w:1) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// The range of component `p` is `[0, 30]`. - fn kill_pure(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `164 + p * (37 ±0)` - // Estimated: `4706` - // Minimum execution time: 22_150_000 picoseconds. - Weight::from_parts(23_367_544, 0) - .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_500 - .saturating_add(Weight::from_parts(24_164, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Proxy::Proxies` (r:1 w:1) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Proxy::Announcements` (r:1 w:1) - /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) - fn poke_deposit() -> Weight { - // Proof Size summary in bytes: - // Measured: `453` - // Estimated: `5698` - // Minimum execution time: 43_886_000 picoseconds. - Weight::from_parts(45_017_000, 0) - .saturating_add(Weight::from_parts(0, 5698)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_session.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_session.rs deleted file mode 100644 index 55bec98555b3b..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_session.rs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_session` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `731f893ee36e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=pallet_session -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_session`. -pub struct WeightInfo(PhantomData); -impl pallet_session::WeightInfo for WeightInfo { - /// Storage: `Session::NextKeys` (r:1 w:1) - /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Session::KeyOwner` (r:1 w:1) - /// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn set_keys() -> Weight { - // Proof Size summary in bytes: - // Measured: `271` - // Estimated: `3736` - // Minimum execution time: 18_189_000 picoseconds. - Weight::from_parts(18_519_000, 0) - .saturating_add(Weight::from_parts(0, 3736)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Session::NextKeys` (r:1 w:1) - /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Session::KeyOwner` (r:0 w:1) - /// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn purge_keys() -> Weight { - // Proof Size summary in bytes: - // Measured: `243` - // Estimated: `3708` - // Minimum execution time: 13_124_000 picoseconds. - Weight::from_parts(13_680_000, 0) - .saturating_add(Weight::from_parts(0, 3708)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_timestamp.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_timestamp.rs deleted file mode 100644 index d1bf00506a585..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_timestamp.rs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_timestamp` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `731f893ee36e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=pallet_timestamp -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_timestamp`. -pub struct WeightInfo(PhantomData); -impl pallet_timestamp::WeightInfo for WeightInfo { - /// Storage: `Timestamp::Now` (r:1 w:1) - /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) - /// Storage: `Aura::CurrentSlot` (r:1 w:0) - /// Proof: `Aura::CurrentSlot` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) - fn set() -> Weight { - // Proof Size summary in bytes: - // Measured: `122` - // Estimated: `1493` - // Minimum execution time: 8_672_000 picoseconds. - Weight::from_parts(9_150_000, 0) - .saturating_add(Weight::from_parts(0, 1493)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - fn on_finalize() -> Weight { - // Proof Size summary in bytes: - // Measured: `94` - // Estimated: `0` - // Minimum execution time: 4_545_000 picoseconds. - Weight::from_parts(4_671_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_transaction_payment.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_transaction_payment.rs deleted file mode 100644 index 3832b2726b389..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_transaction_payment.rs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// This file is part of Cumulus. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_transaction_payment` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-12-21, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `gleipnir`, CPU: `AMD Ryzen 9 7900X 12-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("coretime-rococo-dev")`, DB CACHE: 1024 - -// Executed Command: -// ./target/release/polkadot-parachain -// benchmark -// pallet -// --wasm-execution=compiled -// --pallet=pallet_transaction_payment -// --no-storage-info -// --no-median-slopes -// --no-min-squares -// --extrinsic=* -// --steps=2 -// --repeat=2 -// --json -// --header=./cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/ -// --chain=coretime-rococo-dev - -#![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_transaction_payment`. -pub struct WeightInfo(PhantomData); -impl pallet_transaction_payment::WeightInfo for WeightInfo { - /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0) - /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn charge_transaction_payment() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `3593` - // Minimum execution time: 33_363_000 picoseconds. - Weight::from_parts(38_793_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_utility.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_utility.rs deleted file mode 100644 index fe30d3fea52d6..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_utility.rs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_utility` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `731f893ee36e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=pallet_utility -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_utility`. -pub struct WeightInfo(PhantomData); -impl pallet_utility::WeightInfo for WeightInfo { - /// The range of component `c` is `[0, 1000]`. - fn batch(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_976_000 picoseconds. - Weight::from_parts(6_862_599, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_359 - .saturating_add(Weight::from_parts(3_016_767, 0).saturating_mul(c.into())) - } - fn as_derivative() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_476_000 picoseconds. - Weight::from_parts(4_633_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// The range of component `c` is `[0, 1000]`. - fn batch_all(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_002_000 picoseconds. - Weight::from_parts(1_748_813, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 3_837 - .saturating_add(Weight::from_parts(3_247_545, 0).saturating_mul(c.into())) - } - fn dispatch_as() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_845_000 picoseconds. - Weight::from_parts(7_178_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// The range of component `c` is `[0, 1000]`. - fn force_batch(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_086_000 picoseconds. - Weight::from_parts(5_214_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2_197 - .saturating_add(Weight::from_parts(3_033_800, 0).saturating_mul(c.into())) - } - fn dispatch_as_fallible() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_782_000 picoseconds. - Weight::from_parts(7_084_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn if_else() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 8_384_000 picoseconds. - Weight::from_parts(8_737_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_xcm.rs deleted file mode 100644 index a8fc53528ceb0..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_xcm.rs +++ /dev/null @@ -1,406 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_xcm` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=pallet_xcm -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_xcm`. -pub struct WeightInfo(PhantomData); -impl pallet_xcm::WeightInfo for WeightInfo { - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - fn send() -> Weight { - // Proof Size summary in bytes: - // Measured: `212` - // Estimated: `3677` - // Minimum execution time: 31_555_000 picoseconds. - Weight::from_parts(32_773_000, 0) - .saturating_add(Weight::from_parts(0, 3677)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) - /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) - /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - fn teleport_assets() -> Weight { - // Proof Size summary in bytes: - // Measured: `244` - // Estimated: `3709` - // Minimum execution time: 116_744_000 picoseconds. - Weight::from_parts(120_244_000, 0) - .saturating_add(Weight::from_parts(0, 3709)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) - /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) - /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Broker::Regions` (r:1 w:1) - /// Proof: `Broker::Regions` (`max_values`: None, `max_size`: Some(86), added: 2561, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - fn reserve_transfer_assets() -> Weight { - // Proof Size summary in bytes: - // Measured: `345` - // Estimated: `3810` - // Minimum execution time: 116_448_000 picoseconds. - Weight::from_parts(118_864_000, 0) - .saturating_add(Weight::from_parts(0, 3810)) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) - /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) - /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - fn transfer_assets() -> Weight { - // Proof Size summary in bytes: - // Measured: `244` - // Estimated: `3709` - // Minimum execution time: 117_177_000 picoseconds. - Weight::from_parts(120_737_000, 0) - .saturating_add(Weight::from_parts(0, 3709)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) - /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn execute() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `1485` - // Minimum execution time: 9_083_000 picoseconds. - Weight::from_parts(9_616_000, 0) - .saturating_add(Weight::from_parts(0, 1485)) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: `PolkadotXcm::SupportedVersion` (r:0 w:1) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn force_xcm_version() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 7_808_000 picoseconds. - Weight::from_parts(8_180_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - fn force_default_xcm_version() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_309_000 picoseconds. - Weight::from_parts(2_495_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) - /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) - /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::Queries` (r:0 w:1) - /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn force_subscribe_version_notify() -> Weight { - // Proof Size summary in bytes: - // Measured: `212` - // Estimated: `3677` - // Minimum execution time: 38_166_000 picoseconds. - Weight::from_parts(39_769_000, 0) - .saturating_add(Weight::from_parts(0, 3677)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(5)) - } - /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) - /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::Queries` (r:0 w:1) - /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn force_unsubscribe_version_notify() -> Weight { - // Proof Size summary in bytes: - // Measured: `371` - // Estimated: `108971` - // Minimum execution time: 42_995_000 picoseconds. - Weight::from_parts(44_315_000, 0) - .saturating_add(Weight::from_parts(0, 108971)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `PolkadotXcm::XcmExecutionSuspended` (r:0 w:1) - /// Proof: `PolkadotXcm::XcmExecutionSuspended` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn force_suspension() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_409_000 picoseconds. - Weight::from_parts(2_518_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `PolkadotXcm::SupportedVersion` (r:6 w:2) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn migrate_supported_version() -> Weight { - // Proof Size summary in bytes: - // Measured: `23` - // Estimated: `15863` - // Minimum execution time: 20_235_000 picoseconds. - Weight::from_parts(20_606_000, 0) - .saturating_add(Weight::from_parts(0, 15863)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `PolkadotXcm::VersionNotifiers` (r:6 w:2) - /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn migrate_version_notifiers() -> Weight { - // Proof Size summary in bytes: - // Measured: `27` - // Estimated: `15867` - // Minimum execution time: 20_259_000 picoseconds. - Weight::from_parts(21_120_000, 0) - .saturating_add(Weight::from_parts(0, 15867)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:7 w:0) - /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn already_notified_target() -> Weight { - // Proof Size summary in bytes: - // Measured: `79` - // Estimated: `18394` - // Minimum execution time: 25_370_000 picoseconds. - Weight::from_parts(25_734_000, 0) - .saturating_add(Weight::from_parts(0, 18394)) - .saturating_add(T::DbWeight::get().reads(7)) - } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) - /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn notify_current_targets() -> Weight { - // Proof Size summary in bytes: - // Measured: `155` - // Estimated: `6095` - // Minimum execution time: 35_587_000 picoseconds. - Weight::from_parts(37_045_000, 0) - .saturating_add(Weight::from_parts(0, 6095)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:0) - /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn notify_target_migration_fail() -> Weight { - // Proof Size summary in bytes: - // Measured: `79` - // Estimated: `13444` - // Minimum execution time: 17_717_000 picoseconds. - Weight::from_parts(18_247_000, 0) - .saturating_add(Weight::from_parts(0, 13444)) - .saturating_add(T::DbWeight::get().reads(5)) - } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:2) - /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn migrate_version_notify_targets() -> Weight { - // Proof Size summary in bytes: - // Measured: `34` - // Estimated: `15874` - // Minimum execution time: 20_002_000 picoseconds. - Weight::from_parts(20_802_000, 0) - .saturating_add(Weight::from_parts(0, 15874)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:1) - /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn migrate_and_notify_old_targets() -> Weight { - // Proof Size summary in bytes: - // Measured: `155` - // Estimated: `15995` - // Minimum execution time: 45_805_000 picoseconds. - Weight::from_parts(47_379_000, 0) - .saturating_add(Weight::from_parts(0, 15995)) - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) - /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `PolkadotXcm::Queries` (r:0 w:1) - /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn new_query() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `1485` - // Minimum execution time: 2_673_000 picoseconds. - Weight::from_parts(2_817_000, 0) - .saturating_add(Weight::from_parts(0, 1485)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `PolkadotXcm::Queries` (r:1 w:1) - /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn take_response() -> Weight { - // Proof Size summary in bytes: - // Measured: `7576` - // Estimated: `11041` - // Minimum execution time: 27_286_000 picoseconds. - Weight::from_parts(28_304_000, 0) - .saturating_add(Weight::from_parts(0, 11041)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) - /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) - /// Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn claim_assets() -> Weight { - // Proof Size summary in bytes: - // Measured: `24` - // Estimated: `3489` - // Minimum execution time: 39_233_000 picoseconds. - Weight::from_parts(40_152_000, 0) - .saturating_add(Weight::from_parts(0, 3489)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Benchmark::Override` (r:0 w:0) - /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn add_authorized_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. - Weight::from_parts(18_446_744_073_709_551_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `Benchmark::Override` (r:0 w:0) - /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn remove_authorized_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. - Weight::from_parts(18_446_744_073_709_551_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn weigh_message() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 8_233_000 picoseconds. - Weight::from_parts(8_339_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/paritydb_weights.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/paritydb_weights.rs deleted file mode 100644 index db09e9de7bdf4..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/paritydb_weights.rs +++ /dev/null @@ -1,63 +0,0 @@ -// This file is part of Cumulus. - -// Copyright (C) 2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -pub mod constants { - use frame_support::{ - parameter_types, - weights::{constants, RuntimeDbWeight}, - }; - - parameter_types! { - /// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights - /// are available for brave runtime engineers who may want to try this out as default. - pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 8_000 * constants::WEIGHT_REF_TIME_PER_NANOS, - write: 50_000 * constants::WEIGHT_REF_TIME_PER_NANOS, - }; - } - - #[cfg(test)] - mod test_db_weights { - use super::constants::ParityDbWeight as W; - use frame_support::weights::constants; - - /// Checks that all weights exist and have sane values. - // NOTE: If this test fails but you are sure that the generated values are fine, - // you can delete it. - #[test] - fn sane() { - // At least 1 µs. - assert!( - W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, - "Read weight should be at least 1 µs." - ); - assert!( - W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, - "Write weight should be at least 1 µs." - ); - // At most 1 ms. - assert!( - W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, - "Read weight should be at most 1 ms." - ); - assert!( - W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, - "Write weight should be at most 1 ms." - ); - } - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/rocksdb_weights.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/rocksdb_weights.rs deleted file mode 100644 index 855ec356bca93..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/rocksdb_weights.rs +++ /dev/null @@ -1,63 +0,0 @@ -// This file is part of Cumulus. - -// Copyright (C) 2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -pub mod constants { - use frame_support::{ - parameter_types, - weights::{constants, RuntimeDbWeight}, - }; - - parameter_types! { - /// By default, Substrate uses `RocksDB`, so this will be the weight used throughout - /// the runtime. - pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 25_000 * constants::WEIGHT_REF_TIME_PER_NANOS, - write: 100_000 * constants::WEIGHT_REF_TIME_PER_NANOS, - }; - } - - #[cfg(test)] - mod test_db_weights { - use super::constants::RocksDbWeight as W; - use frame_support::weights::constants; - - /// Checks that all weights exist and have sane values. - // NOTE: If this test fails but you are sure that the generated values are fine, - // you can delete it. - #[test] - fn sane() { - // At least 1 µs. - assert!( - W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, - "Read weight should be at least 1 µs." - ); - assert!( - W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, - "Write weight should be at least 1 µs." - ); - // At most 1 ms. - assert!( - W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, - "Read weight should be at most 1 ms." - ); - assert!( - W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, - "Write weight should be at most 1 ms." - ); - } - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/mod.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/mod.rs deleted file mode 100644 index ce2279e2ba8e8..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/mod.rs +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// This file is part of Cumulus. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -mod pallet_xcm_benchmarks_fungible; -mod pallet_xcm_benchmarks_generic; - -use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; -use alloc::vec::Vec; -use frame_support::weights::Weight; -use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; -use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; -use sp_runtime::BoundedVec; -use xcm::{ - latest::{prelude::*, AssetTransferFilter}, - DoubleEncoded, -}; - -trait WeighAssets { - fn weigh_assets(&self, weight: Weight) -> Weight; -} - -const MAX_ASSETS: u64 = 100; - -impl WeighAssets for AssetFilter { - fn weigh_assets(&self, weight: Weight) -> Weight { - match self { - Self::Definite(assets) => weight.saturating_mul(assets.inner().iter().count() as u64), - Self::Wild(asset) => match asset { - All => weight.saturating_mul(MAX_ASSETS), - AllOf { fun, .. } => match fun { - WildFungibility::Fungible => weight, - // Magic number 2 has to do with the fact that we could have up to 2 times - // MaxAssetsIntoHolding in the worst-case scenario. - WildFungibility::NonFungible => - weight.saturating_mul((MaxAssetsIntoHolding::get() * 2) as u64), - }, - AllCounted(count) => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - AllOfCounted { count, .. } => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - }, - } - } -} - -impl WeighAssets for Assets { - fn weigh_assets(&self, weight: Weight) -> Weight { - weight.saturating_mul(self.inner().iter().count() as u64) - } -} - -pub struct CoretimeRococoXcmWeight(core::marker::PhantomData); -impl XcmWeightInfo for CoretimeRococoXcmWeight { - fn withdraw_asset(assets: &Assets) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::withdraw_asset()) - } - fn reserve_asset_deposited(assets: &Assets) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::reserve_asset_deposited()) - } - fn receive_teleported_asset(assets: &Assets) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::receive_teleported_asset()) - } - fn query_response( - _query_id: &u64, - _response: &Response, - _max_weight: &Weight, - _querier: &Option, - ) -> Weight { - XcmGeneric::::query_response() - } - fn transfer_asset(assets: &Assets, _dest: &Location) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::transfer_asset()) - } - fn transfer_reserve_asset(assets: &Assets, _dest: &Location, _xcm: &Xcm<()>) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::transfer_reserve_asset()) - } - fn transact( - _origin_type: &OriginKind, - _fallback_max_weight: &Option, - _call: &DoubleEncoded, - ) -> Weight { - XcmGeneric::::transact() - } - fn hrmp_new_channel_open_request( - _sender: &u32, - _max_message_size: &u32, - _max_capacity: &u32, - ) -> Weight { - // XCM Executor does not currently support HRMP channel operations - Weight::MAX - } - fn hrmp_channel_accepted(_recipient: &u32) -> Weight { - // XCM Executor does not currently support HRMP channel operations - Weight::MAX - } - fn hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> Weight { - // XCM Executor does not currently support HRMP channel operations - Weight::MAX - } - fn clear_origin() -> Weight { - XcmGeneric::::clear_origin() - } - fn descend_origin(_who: &InteriorLocation) -> Weight { - XcmGeneric::::descend_origin() - } - fn report_error(_query_response_info: &QueryResponseInfo) -> Weight { - XcmGeneric::::report_error() - } - fn deposit_asset(assets: &AssetFilter, _dest: &Location) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::deposit_asset()) - } - fn deposit_reserve_asset(assets: &AssetFilter, _dest: &Location, _xcm: &Xcm<()>) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::deposit_reserve_asset()) - } - fn exchange_asset(_give: &AssetFilter, _receive: &Assets, _maximal: &bool) -> Weight { - Weight::MAX - } - fn initiate_reserve_withdraw( - assets: &AssetFilter, - _reserve: &Location, - _xcm: &Xcm<()>, - ) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::initiate_reserve_withdraw()) - } - fn initiate_teleport(assets: &AssetFilter, _dest: &Location, _xcm: &Xcm<()>) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::initiate_teleport()) - } - fn initiate_transfer( - _dest: &Location, - remote_fees: &Option, - _preserve_origin: &bool, - assets: &BoundedVec, - _xcm: &Xcm<()>, - ) -> Weight { - let mut weight = if let Some(remote_fees) = remote_fees { - let fees = remote_fees.inner(); - fees.weigh_assets(XcmFungibleWeight::::initiate_transfer()) - } else { - Weight::zero() - }; - for asset_filter in assets { - let assets = asset_filter.inner(); - let extra = assets.weigh_assets(XcmFungibleWeight::::initiate_transfer()); - weight = weight.saturating_add(extra); - } - weight - } - fn report_holding(_response_info: &QueryResponseInfo, _assets: &AssetFilter) -> Weight { - XcmGeneric::::report_holding() - } - fn buy_execution(_fees: &Asset, _weight_limit: &WeightLimit) -> Weight { - XcmGeneric::::buy_execution() - } - fn pay_fees(_asset: &Asset) -> Weight { - XcmGeneric::::pay_fees() - } - fn refund_surplus() -> Weight { - XcmGeneric::::refund_surplus() - } - fn set_error_handler(_xcm: &Xcm) -> Weight { - XcmGeneric::::set_error_handler() - } - fn set_appendix(_xcm: &Xcm) -> Weight { - XcmGeneric::::set_appendix() - } - fn clear_error() -> Weight { - XcmGeneric::::clear_error() - } - fn claim_asset(_assets: &Assets, _ticket: &Location) -> Weight { - XcmGeneric::::claim_asset() - } - fn trap(_code: &u64) -> Weight { - XcmGeneric::::trap() - } - fn subscribe_version(_query_id: &QueryId, _max_response_weight: &Weight) -> Weight { - XcmGeneric::::subscribe_version() - } - fn unsubscribe_version() -> Weight { - XcmGeneric::::unsubscribe_version() - } - fn burn_asset(assets: &Assets) -> Weight { - assets.weigh_assets(XcmGeneric::::burn_asset()) - } - fn expect_asset(assets: &Assets) -> Weight { - assets.weigh_assets(XcmGeneric::::expect_asset()) - } - fn expect_origin(_origin: &Option) -> Weight { - XcmGeneric::::expect_origin() - } - fn expect_error(_error: &Option<(u32, XcmError)>) -> Weight { - XcmGeneric::::expect_error() - } - fn expect_transact_status(_transact_status: &MaybeErrorCode) -> Weight { - XcmGeneric::::expect_transact_status() - } - fn query_pallet(_module_name: &Vec, _response_info: &QueryResponseInfo) -> Weight { - XcmGeneric::::query_pallet() - } - fn expect_pallet( - _index: &u32, - _name: &Vec, - _module_name: &Vec, - _crate_major: &u32, - _min_crate_minor: &u32, - ) -> Weight { - XcmGeneric::::expect_pallet() - } - fn report_transact_status(_response_info: &QueryResponseInfo) -> Weight { - XcmGeneric::::report_transact_status() - } - fn clear_transact_status() -> Weight { - XcmGeneric::::clear_transact_status() - } - fn universal_origin(_: &Junction) -> Weight { - Weight::MAX - } - fn export_message(_: &NetworkId, _: &Junctions, _: &Xcm<()>) -> Weight { - Weight::MAX - } - fn lock_asset(_: &Asset, _: &Location) -> Weight { - Weight::MAX - } - fn unlock_asset(_: &Asset, _: &Location) -> Weight { - Weight::MAX - } - fn note_unlockable(_: &Asset, _: &Location) -> Weight { - Weight::MAX - } - fn request_unlock(_: &Asset, _: &Location) -> Weight { - Weight::MAX - } - fn set_fees_mode(_: &bool) -> Weight { - XcmGeneric::::set_fees_mode() - } - fn set_topic(_topic: &[u8; 32]) -> Weight { - XcmGeneric::::set_topic() - } - fn clear_topic() -> Weight { - XcmGeneric::::clear_topic() - } - fn alias_origin(_: &Location) -> Weight { - // XCM Executor does not currently support alias origin operations - Weight::MAX - } - fn unpaid_execution(_: &WeightLimit, _: &Option) -> Weight { - XcmGeneric::::unpaid_execution() - } - fn set_hints(hints: &BoundedVec) -> Weight { - let mut weight = Weight::zero(); - for hint in hints { - match hint { - AssetClaimer { .. } => { - weight = weight.saturating_add(XcmGeneric::::asset_claimer()); - }, - } - } - weight - } - fn execute_with_origin(_: &Option, _: &Xcm) -> Weight { - XcmGeneric::::execute_with_origin() - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs deleted file mode 100644 index ebaf937171245..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_xcm_benchmarks::fungible` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=pallet_xcm_benchmarks::fungible -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --template=cumulus/templates/xcm-bench-template.hbs -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use core::marker::PhantomData; - -/// Weights for `pallet_xcm_benchmarks::fungible`. -pub struct WeightInfo(PhantomData); -impl WeightInfo { - // Storage: `System::Account` (r:1 w:1) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - pub fn withdraw_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `101` - // Estimated: `3593` - // Minimum execution time: 31_106_000 picoseconds. - Weight::from_parts(31_668_000, 3593) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: `System::Account` (r:2 w:2) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - pub fn transfer_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `101` - // Estimated: `6196` - // Minimum execution time: 42_763_000 picoseconds. - Weight::from_parts(43_487_000, 6196) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - // Storage: `System::Account` (r:3 w:3) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn transfer_reserve_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `345` - // Estimated: `8799` - // Minimum execution time: 111_295_000 picoseconds. - Weight::from_parts(113_994_000, 8799) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(5)) - } - // Storage: `Benchmark::Override` (r:0 w:0) - // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) - pub fn reserve_asset_deposited() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. - Weight::from_parts(18_446_744_073_709_551_000, 0) - } - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `System::Account` (r:2 w:2) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn initiate_reserve_withdraw() -> Weight { - // Proof Size summary in bytes: - // Measured: `345` - // Estimated: `6196` - // Minimum execution time: 80_772_000 picoseconds. - Weight::from_parts(83_123_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - pub fn receive_teleported_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_657_000 picoseconds. - Weight::from_parts(2_896_000, 0) - } - // Storage: `System::Account` (r:1 w:1) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - pub fn deposit_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 23_835_000 picoseconds. - Weight::from_parts(24_763_000, 3593) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `System::Account` (r:1 w:1) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn deposit_reserve_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `244` - // Estimated: `3709` - // Minimum execution time: 69_246_000 picoseconds. - Weight::from_parts(70_977_000, 3709) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn initiate_teleport() -> Weight { - // Proof Size summary in bytes: - // Measured: `244` - // Estimated: `3709` - // Minimum execution time: 47_816_000 picoseconds. - Weight::from_parts(49_514_000, 3709) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) - } - // Storage: `System::Account` (r:2 w:2) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn initiate_transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `244` - // Estimated: `6196` - // Minimum execution time: 95_244_000 picoseconds. - Weight::from_parts(97_468_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs deleted file mode 100644 index 2aa90dc75a771..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ /dev/null @@ -1,368 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_xcm_benchmarks::generic` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.wasm -// --pallet=pallet_xcm_benchmarks::generic -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/xcm -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --template=cumulus/templates/xcm-bench-template.hbs -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use core::marker::PhantomData; - -/// Weights for `pallet_xcm_benchmarks::generic`. -pub struct WeightInfo(PhantomData); -impl WeightInfo { - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `System::Account` (r:2 w:2) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn report_holding() -> Weight { - // Proof Size summary in bytes: - // Measured: `345` - // Estimated: `6196` - // Minimum execution time: 78_005_000 picoseconds. - Weight::from_parts(79_932_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - // Storage: `System::Account` (r:1 w:1) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - pub fn buy_execution() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 3_719_000 picoseconds. - Weight::from_parts(4_115_000, 3593) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: `System::Account` (r:1 w:1) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - pub fn pay_fees() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 3_667_000 picoseconds. - Weight::from_parts(3_993_000, 3593) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - pub fn asset_claimer() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 682_000 picoseconds. - Weight::from_parts(783_000, 0) - } - // Storage: `PolkadotXcm::Queries` (r:1 w:0) - // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) - pub fn query_response() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3465` - // Minimum execution time: 5_687_000 picoseconds. - Weight::from_parts(5_891_000, 3465) - .saturating_add(T::DbWeight::get().reads(1)) - } - pub fn transact() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 7_108_000 picoseconds. - Weight::from_parts(7_371_000, 0) - } - pub fn refund_surplus() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_158_000 picoseconds. - Weight::from_parts(1_245_000, 0) - } - pub fn set_error_handler() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 709_000 picoseconds. - Weight::from_parts(763_000, 0) - } - pub fn set_appendix() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 692_000 picoseconds. - Weight::from_parts(756_000, 0) - } - pub fn clear_error() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 662_000 picoseconds. - Weight::from_parts(721_000, 0) - } - pub fn descend_origin() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 706_000 picoseconds. - Weight::from_parts(754_000, 0) - } - // Storage: `Benchmark::Override` (r:0 w:0) - // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) - pub fn execute_with_origin() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. - Weight::from_parts(18_446_744_073_709_551_000, 0) - } - pub fn clear_origin() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 683_000 picoseconds. - Weight::from_parts(720_000, 0) - } - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `System::Account` (r:2 w:2) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn report_error() -> Weight { - // Proof Size summary in bytes: - // Measured: `345` - // Estimated: `6196` - // Minimum execution time: 74_570_000 picoseconds. - Weight::from_parts(77_129_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - // Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) - // Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) - pub fn claim_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `24` - // Estimated: `3489` - // Minimum execution time: 8_917_000 picoseconds. - Weight::from_parts(9_342_000, 3489) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - pub fn trap() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_270_000 picoseconds. - Weight::from_parts(3_460_000, 0) - } - // Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1) - // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn subscribe_version() -> Weight { - // Proof Size summary in bytes: - // Measured: `212` - // Estimated: `3677` - // Minimum execution time: 31_710_000 picoseconds. - Weight::from_parts(32_692_000, 3677) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(3)) - } - // Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1) - // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - pub fn unsubscribe_version() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_065_000 picoseconds. - Weight::from_parts(3_282_000, 0) - .saturating_add(T::DbWeight::get().writes(1)) - } - pub fn burn_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_063_000 picoseconds. - Weight::from_parts(1_134_000, 0) - } - pub fn expect_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 773_000 picoseconds. - Weight::from_parts(800_000, 0) - } - pub fn expect_origin() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_328_000 picoseconds. - Weight::from_parts(3_437_000, 0) - } - pub fn expect_error() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_234_000 picoseconds. - Weight::from_parts(3_383_000, 0) - } - pub fn expect_transact_status() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 796_000 picoseconds. - Weight::from_parts(873_000, 0) - } - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `System::Account` (r:2 w:2) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn query_pallet() -> Weight { - // Proof Size summary in bytes: - // Measured: `345` - // Estimated: `6196` - // Minimum execution time: 79_173_000 picoseconds. - Weight::from_parts(80_575_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - pub fn expect_pallet() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_560_000 picoseconds. - Weight::from_parts(3_725_000, 0) - } - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `System::Account` (r:2 w:2) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn report_transact_status() -> Weight { - // Proof Size summary in bytes: - // Measured: `345` - // Estimated: `6196` - // Minimum execution time: 74_574_000 picoseconds. - Weight::from_parts(76_468_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - pub fn clear_transact_status() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 697_000 picoseconds. - Weight::from_parts(777_000, 0) - } - pub fn set_topic() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 642_000 picoseconds. - Weight::from_parts(711_000, 0) - } - pub fn clear_topic() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 666_000 picoseconds. - Weight::from_parts(702_000, 0) - } - pub fn set_fees_mode() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 653_000 picoseconds. - Weight::from_parts(718_000, 0) - } - pub fn unpaid_execution() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 657_000 picoseconds. - Weight::from_parts(710_000, 0) - } -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/xcm_config.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/src/xcm_config.rs deleted file mode 100644 index 8cf14d103f1c5..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/src/xcm_config.rs +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// This file is part of Cumulus. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use super::{ - AccountId, AllPalletsWithSystem, Balances, BaseDeliveryFee, Broker, FeeAssetId, ParachainInfo, - ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, - TransactionByteFee, WeightToFee, XcmpQueue, -}; -use frame_support::{ - pallet_prelude::PalletInfoAccess, - parameter_types, - traits::{ - tokens::imbalance::ResolveTo, ConstU32, Contains, Disabled, Equals, Everything, Nothing, - }, -}; -use frame_system::EnsureRoot; -use pallet_collator_selection::StakingPotAccountId; -use pallet_xcm::XcmPassthrough; -use parachains_common::{ - xcm_config::{ - AllSiblingSystemParachains, ConcreteAssetFromSystem, ParentRelayOrSiblingParachains, - RelayOrOtherSystemParachains, - }, - TREASURY_PALLET_ID, -}; -use polkadot_parachain_primitives::primitives::Sibling; -use polkadot_runtime_common::xcm_sender::ExponentialPrice; -use sp_runtime::traits::AccountIdConversion; -use xcm::latest::{prelude::*, ROCOCO_GENESIS_HASH}; -use xcm_builder::{ - AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowHrmpNotificationsFromRelayChain, - AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, - DenyRecursively, DenyReserveTransferToRelayChain, DenyThenTry, DescribeAllTerminal, - DescribeFamily, EnsureXcmOrigin, FrameTransactionalProcessor, FungibleAdapter, - HashedDescription, IsConcrete, NonFungibleAdapter, ParentAsSuperuser, ParentIsPreset, - RelayChainAsNative, SendXcmFeeToAccount, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, - XcmFeeManagerFromComponents, -}; -use xcm_executor::XcmExecutor; - -parameter_types! { - pub const RootLocation: Location = Location::here(); - pub const RocRelayLocation: Location = Location::parent(); - pub const RelayNetwork: Option = Some(NetworkId::ByGenesis(ROCOCO_GENESIS_HASH)); - pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorLocation = - [GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())].into(); - pub BrokerPalletLocation: Location = - PalletInstance(::index() as u8).into(); - pub const MaxInstructions: u32 = 100; - pub const MaxAssetsIntoHolding: u32 = 64; - pub const GovernanceLocation: Location = Location::parent(); - pub const FellowshipLocation: Location = Location::parent(); -} - -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. -pub type LocationToAccountId = ( - // The parent (Relay-chain) origin converts to the parent `AccountId`. - ParentIsPreset, - // Sibling parachain origins convert to AccountId via the `ParaId::into`. - SiblingParachainConvertsVia, - // Straight up local `AccountId32` origins just alias directly to `AccountId`. - AccountId32Aliases, - // Foreign locations alias into accounts according to a hash of their standard description. - HashedDescription>, -); - -/// Means for transacting the native currency on this chain. -pub type FungibleTransactor = FungibleAdapter< - // Use this currency: - Balances, - // Use this currency when it is a fungible asset matching the given location or name: - IsConcrete, - // Do a simple punn to convert an `AccountId32` `Location` into a native chain - // `AccountId`: - LocationToAccountId, - // Our chain's `AccountId` type (we can't get away without mentioning it explicitly): - AccountId, - // We don't track any teleports of `Balances`. - (), ->; - -/// Means for transacting coretime regions on this chain. -pub type RegionTransactor = NonFungibleAdapter< - // Use this non-fungible implementation: - Broker, - // This adapter will handle coretime regions from the broker pallet. - IsConcrete, - // Convert an XCM Location into a local account id: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We don't track any teleports. - (), ->; - -/// Means for transacting assets on this chain. -pub type AssetTransactors = (FungibleTransactor, RegionTransactor); - -/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with XCM's `Transact`. There is an `OriginKind` that can -/// bias the kind of local `Origin` it will become. -pub type XcmOriginToTransactDispatchOrigin = ( - // Sovereign account converter; this attempts to derive an `AccountId` from the origin location - // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for - // foreign chains who want to have a local sovereign account on this chain that they control. - SovereignSignedViaLocation, - // Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when - // recognized. - RelayChainAsNative, - // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when - // recognized. - SiblingParachainAsNative, - // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a - // transaction from the Root origin. - ParentAsSuperuser, - // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `RuntimeOrigin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, - // XCM origins can be represented natively under the XCM pallet's `Xcm` origin. - XcmPassthrough, -); - -pub struct ParentOrParentsPlurality; -impl Contains for ParentOrParentsPlurality { - fn contains(location: &Location) -> bool { - matches!(location.unpack(), (1, []) | (1, [Plurality { .. }])) - } -} - -pub type Barrier = TrailingSetTopicAsId< - DenyThenTry< - DenyRecursively, - ( - // Allow local users to buy weight credit. - TakeWeightCredit, - // Expected responses are OK. - AllowKnownQueryResponses, - WithComputedOrigin< - ( - // If the message is one that immediately attempts to pay for execution, then - // allow it. - AllowTopLevelPaidExecutionFrom, - // Parent and its pluralities (i.e. governance bodies) get free execution. - AllowExplicitUnpaidExecutionFrom, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, - // HRMP notifications from the relay chain are OK. - AllowHrmpNotificationsFromRelayChain, - ), - UniversalLocation, - ConstU32<8>, - >, - ), - >, ->; - -parameter_types! { - pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating(); - pub RelayTreasuryLocation: Location = (Parent, PalletInstance(rococo_runtime_constants::TREASURY_PALLET_ID)).into(); -} - -/// Locations that will not be charged fees in the executor, neither for execution nor delivery. -/// We only waive fees for system functions, which these locations represent. -pub type WaivedLocations = ( - Equals, - RelayOrOtherSystemParachains, - Equals, -); - -/// Cases where a remote origin is accepted as trusted Teleporter for a given asset: -/// - ROC with the parent Relay Chain and sibling parachains. -pub type TrustedTeleporters = ConcreteAssetFromSystem; - -pub struct XcmConfig; -impl xcm_executor::Config for XcmConfig { - type RuntimeCall = RuntimeCall; - type XcmSender = XcmRouter; - type XcmEventEmitter = PolkadotXcm; - type AssetTransactor = AssetTransactors; - type OriginConverter = XcmOriginToTransactDispatchOrigin; - // Coretime chain does not recognize a reserve location for any asset. Users must teleport ROC - // where allowed (e.g. with the Relay Chain). - type IsReserve = (); - type IsTeleporter = TrustedTeleporters; - type UniversalLocation = UniversalLocation; - type Barrier = Barrier; - type Weigher = WeightInfoBounds< - crate::weights::xcm::CoretimeRococoXcmWeight, - RuntimeCall, - MaxInstructions, - >; - type Trader = UsingComponents< - WeightToFee, - RocRelayLocation, - AccountId, - Balances, - ResolveTo, Balances>, - >; - type ResponseHandler = PolkadotXcm; - type AssetTrap = PolkadotXcm; - type AssetClaims = PolkadotXcm; - type SubscriptionService = PolkadotXcm; - type PalletInstancesInfo = AllPalletsWithSystem; - type MaxAssetsIntoHolding = MaxAssetsIntoHolding; - type AssetLocker = (); - type AssetExchanger = (); - type FeeManager = XcmFeeManagerFromComponents< - WaivedLocations, - SendXcmFeeToAccount, - >; - type MessageExporter = (); - type UniversalAliases = Nothing; - type CallDispatcher = RuntimeCall; - type SafeCallFilter = Everything; - type Aliasers = Nothing; - type TransactionalProcessor = FrameTransactionalProcessor; - type HrmpNewChannelOpenRequestHandler = (); - type HrmpChannelAcceptedHandler = (); - type HrmpChannelClosingHandler = (); - type XcmRecorder = PolkadotXcm; -} - -/// Converts a local signed origin into an XCM location. Forms the basis for local origins -/// sending/executing XCMs. -pub type LocalOriginToLocation = SignedToAccountId32; - -pub type PriceForParentDelivery = - ExponentialPrice; - -/// The means for routing XCM messages which are not for local execution into the right message -/// queues. -pub type XcmRouter = WithUniqueTopic<( - // Two routers - use UMP to communicate with the relay chain: - cumulus_primitives_utility::ParentAsUmp, - // ..and XCMP to communicate with the sibling chains. - XcmpQueue, -)>; - -impl pallet_xcm::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - // We want to disallow users sending (arbitrary) XCM programs from this chain. - type SendXcmOrigin = EnsureXcmOrigin; - type XcmRouter = XcmRouter; - // We support local origins dispatching XCM executions. - type ExecuteXcmOrigin = EnsureXcmOrigin; - type XcmExecuteFilter = Everything; - type XcmExecutor = XcmExecutor; - type XcmTeleportFilter = Everything; - type XcmReserveTransferFilter = Everything; - type Weigher = WeightInfoBounds< - crate::weights::xcm::CoretimeRococoXcmWeight, - RuntimeCall, - MaxInstructions, - >; - type UniversalLocation = UniversalLocation; - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; - type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; - type Currency = Balances; - type CurrencyMatcher = (); - type TrustedLockers = (); - type SovereignAccountOf = LocationToAccountId; - type MaxLockers = ConstU32<8>; - type WeightInfo = crate::weights::pallet_xcm::WeightInfo; - type AdminOrigin = EnsureRoot; - type MaxRemoteLockConsumers = ConstU32<0>; - type RemoteLockConsumerIdentifier = (); - // Aliasing is disabled: xcm_executor::Config::Aliasers is set to `Nothing`. - type AuthorizedAliasConsideration = Disabled; -} - -impl cumulus_pallet_xcm::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type XcmExecutor = XcmExecutor; -} diff --git a/cumulus/parachains/runtimes/coretime/coretime-rococo/tests/tests.rs b/cumulus/parachains/runtimes/coretime/coretime-rococo/tests/tests.rs deleted file mode 100644 index 10568ea77ae55..0000000000000 --- a/cumulus/parachains/runtimes/coretime/coretime-rococo/tests/tests.rs +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// This file is part of Cumulus. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#![cfg(test)] - -use coretime_rococo_runtime::{ - xcm_config::LocationToAccountId, Block, Runtime, RuntimeCall, RuntimeOrigin, -}; -use parachains_common::AccountId; -use sp_core::crypto::Ss58Codec; -use testnet_parachains_constants::rococo::fee::WeightToFee; -use xcm::latest::prelude::*; -use xcm_runtime_apis::conversions::LocationToAccountHelper; - -const ALICE: [u8; 32] = [1u8; 32]; - -#[test] -fn location_conversion_works() { - // the purpose of hardcoded values is to catch an unintended location conversion logic change. - struct TestCase { - description: &'static str, - location: Location, - expected_account_id_str: &'static str, - } - - let test_cases = vec![ - // DescribeTerminus - TestCase { - description: "DescribeTerminus Parent", - location: Location::new(1, Here), - expected_account_id_str: "5Dt6dpkWPwLaH4BBCKJwjiWrFVAGyYk3tLUabvyn4v7KtESG", - }, - TestCase { - description: "DescribeTerminus Sibling", - location: Location::new(1, [Parachain(1111)]), - expected_account_id_str: "5Eg2fnssmmJnF3z1iZ1NouAuzciDaaDQH7qURAy3w15jULDk", - }, - // DescribePalletTerminal - TestCase { - description: "DescribePalletTerminal Parent", - location: Location::new(1, [PalletInstance(50)]), - expected_account_id_str: "5CnwemvaAXkWFVwibiCvf2EjqwiqBi29S5cLLydZLEaEw6jZ", - }, - TestCase { - description: "DescribePalletTerminal Sibling", - location: Location::new(1, [Parachain(1111), PalletInstance(50)]), - expected_account_id_str: "5GFBgPjpEQPdaxEnFirUoa51u5erVx84twYxJVuBRAT2UP2g", - }, - // DescribeAccountId32Terminal - TestCase { - description: "DescribeAccountId32Terminal Parent", - location: Location::new( - 1, - [Junction::AccountId32 { network: None, id: AccountId::from(ALICE).into() }], - ), - expected_account_id_str: "5DN5SGsuUG7PAqFL47J9meViwdnk9AdeSWKFkcHC45hEzVz4", - }, - TestCase { - description: "DescribeAccountId32Terminal Sibling", - location: Location::new( - 1, - [ - Parachain(1111), - Junction::AccountId32 { network: None, id: AccountId::from(ALICE).into() }, - ], - ), - expected_account_id_str: "5DGRXLYwWGce7wvm14vX1Ms4Vf118FSWQbJkyQigY2pfm6bg", - }, - // DescribeAccountKey20Terminal - TestCase { - description: "DescribeAccountKey20Terminal Parent", - location: Location::new(1, [AccountKey20 { network: None, key: [0u8; 20] }]), - expected_account_id_str: "5F5Ec11567pa919wJkX6VHtv2ZXS5W698YCW35EdEbrg14cg", - }, - TestCase { - description: "DescribeAccountKey20Terminal Sibling", - location: Location::new( - 1, - [Parachain(1111), AccountKey20 { network: None, key: [0u8; 20] }], - ), - expected_account_id_str: "5CB2FbUds2qvcJNhDiTbRZwiS3trAy6ydFGMSVutmYijpPAg", - }, - // DescribeTreasuryVoiceTerminal - TestCase { - description: "DescribeTreasuryVoiceTerminal Parent", - location: Location::new(1, [Plurality { id: BodyId::Treasury, part: BodyPart::Voice }]), - expected_account_id_str: "5CUjnE2vgcUCuhxPwFoQ5r7p1DkhujgvMNDHaF2bLqRp4D5F", - }, - TestCase { - description: "DescribeTreasuryVoiceTerminal Sibling", - location: Location::new( - 1, - [Parachain(1111), Plurality { id: BodyId::Treasury, part: BodyPart::Voice }], - ), - expected_account_id_str: "5G6TDwaVgbWmhqRUKjBhRRnH4ry9L9cjRymUEmiRsLbSE4gB", - }, - // DescribeBodyTerminal - TestCase { - description: "DescribeBodyTerminal Parent", - location: Location::new(1, [Plurality { id: BodyId::Unit, part: BodyPart::Voice }]), - expected_account_id_str: "5EBRMTBkDisEXsaN283SRbzx9Xf2PXwUxxFCJohSGo4jYe6B", - }, - TestCase { - description: "DescribeBodyTerminal Sibling", - location: Location::new( - 1, - [Parachain(1111), Plurality { id: BodyId::Unit, part: BodyPart::Voice }], - ), - expected_account_id_str: "5DBoExvojy8tYnHgLL97phNH975CyT45PWTZEeGoBZfAyRMH", - }, - ]; - - for tc in test_cases { - let expected = - AccountId::from_string(tc.expected_account_id_str).expect("Invalid AccountId string"); - - let got = LocationToAccountHelper::::convert_location( - tc.location.into(), - ) - .unwrap(); - - assert_eq!(got, expected, "{}", tc.description); - } -} - -#[test] -fn xcm_payment_api_works() { - parachains_runtimes_test_utils::test_cases::xcm_payment_api_with_native_token_works::< - Runtime, - RuntimeCall, - RuntimeOrigin, - Block, - WeightToFee, - >(); -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/Cargo.toml b/cumulus/parachains/runtimes/people/people-rococo/Cargo.toml deleted file mode 100644 index ade7dee71673c..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/Cargo.toml +++ /dev/null @@ -1,221 +0,0 @@ -[package] -name = "people-rococo-runtime" -version = "0.1.0" -authors.workspace = true -edition.workspace = true -description = "Rococo's People parachain runtime" -license = "Apache-2.0" -homepage.workspace = true -repository.workspace = true - -[lints] -workspace = true - -[dependencies] -codec = { features = ["derive"], workspace = true } -enumflags2 = { workspace = true } -scale-info = { features = ["derive"], workspace = true } -serde = { optional = true, features = ["derive"], workspace = true, default-features = true } -serde_json = { features = ["alloc"], workspace = true } -tracing = { workspace = true } - -# Substrate -frame-benchmarking = { optional = true, workspace = true } -frame-executive = { workspace = true } -frame-support = { workspace = true } -frame-system = { workspace = true } -frame-system-benchmarking = { optional = true, workspace = true } -frame-system-rpc-runtime-api = { workspace = true } -frame-try-runtime = { optional = true, workspace = true } -pallet-aura = { workspace = true } -pallet-authorship = { workspace = true } -pallet-balances = { workspace = true } -pallet-identity = { workspace = true } -pallet-message-queue = { workspace = true } -pallet-migrations = { workspace = true } -pallet-multisig = { workspace = true } -pallet-proxy = { workspace = true } -pallet-session = { workspace = true } -pallet-timestamp = { workspace = true } -pallet-transaction-payment = { workspace = true } -pallet-transaction-payment-rpc-runtime-api = { workspace = true } -pallet-utility = { workspace = true } -sp-api = { workspace = true } -sp-block-builder = { workspace = true } -sp-consensus-aura = { workspace = true } -sp-core = { workspace = true } -sp-genesis-builder = { workspace = true } -sp-inherents = { workspace = true } -sp-keyring = { workspace = true } -sp-offchain = { workspace = true } -sp-runtime = { workspace = true } -sp-session = { workspace = true } -sp-storage = { workspace = true } -sp-transaction-pool = { workspace = true } -sp-version = { workspace = true } - -# Polkadot -pallet-xcm = { workspace = true } -pallet-xcm-benchmarks = { optional = true, workspace = true } -polkadot-parachain-primitives = { workspace = true } -polkadot-runtime-common = { workspace = true } -rococo-runtime-constants = { workspace = true } -xcm = { workspace = true } -xcm-builder = { workspace = true } -xcm-executor = { workspace = true } -xcm-runtime-apis = { workspace = true } - -# Cumulus -cumulus-pallet-aura-ext = { workspace = true } -cumulus-pallet-parachain-system = { workspace = true } -cumulus-pallet-session-benchmarking = { workspace = true } -cumulus-pallet-weight-reclaim = { workspace = true } -cumulus-pallet-xcm = { workspace = true } -cumulus-pallet-xcmp-queue = { workspace = true } -cumulus-primitives-aura = { workspace = true } -cumulus-primitives-core = { workspace = true } -cumulus-primitives-utility = { workspace = true } -pallet-collator-selection = { workspace = true } -parachain-info = { workspace = true } -parachains-common = { workspace = true } -testnet-parachains-constants = { features = ["rococo"], workspace = true } - -[dev-dependencies] -parachains-runtimes-test-utils = { workspace = true, default-features = true } - -[build-dependencies] -substrate-wasm-builder = { optional = true, workspace = true, default-features = true } - -[features] -default = ["std"] -std = [ - "codec/std", - "cumulus-pallet-aura-ext/std", - "cumulus-pallet-parachain-system/std", - "cumulus-pallet-session-benchmarking/std", - "cumulus-pallet-weight-reclaim/std", - "cumulus-pallet-xcm/std", - "cumulus-pallet-xcmp-queue/std", - "cumulus-primitives-aura/std", - "cumulus-primitives-core/std", - "cumulus-primitives-utility/std", - "enumflags2/std", - "frame-benchmarking?/std", - "frame-executive/std", - "frame-support/std", - "frame-system-benchmarking?/std", - "frame-system-rpc-runtime-api/std", - "frame-system/std", - "frame-try-runtime?/std", - "pallet-aura/std", - "pallet-authorship/std", - "pallet-balances/std", - "pallet-collator-selection/std", - "pallet-identity/std", - "pallet-message-queue/std", - "pallet-migrations/std", - "pallet-multisig/std", - "pallet-proxy/std", - "pallet-session/std", - "pallet-timestamp/std", - "pallet-transaction-payment-rpc-runtime-api/std", - "pallet-transaction-payment/std", - "pallet-utility/std", - "pallet-xcm-benchmarks?/std", - "pallet-xcm/std", - "parachain-info/std", - "parachains-common/std", - "polkadot-parachain-primitives/std", - "polkadot-runtime-common/std", - "rococo-runtime-constants/std", - "scale-info/std", - "serde", - "serde_json/std", - "sp-api/std", - "sp-block-builder/std", - "sp-consensus-aura/std", - "sp-core/std", - "sp-genesis-builder/std", - "sp-inherents/std", - "sp-keyring/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-storage/std", - "sp-transaction-pool/std", - "sp-version/std", - "substrate-wasm-builder", - "testnet-parachains-constants/std", - "tracing/std", - "xcm-builder/std", - "xcm-executor/std", - "xcm-runtime-apis/std", - "xcm/std", -] -runtime-benchmarks = [ - "cumulus-pallet-parachain-system/runtime-benchmarks", - "cumulus-pallet-session-benchmarking/runtime-benchmarks", - "cumulus-pallet-weight-reclaim/runtime-benchmarks", - "cumulus-pallet-xcmp-queue/runtime-benchmarks", - "cumulus-primitives-core/runtime-benchmarks", - "cumulus-primitives-utility/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system-benchmarking/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-collator-selection/runtime-benchmarks", - "pallet-identity/runtime-benchmarks", - "pallet-message-queue/runtime-benchmarks", - "pallet-migrations/runtime-benchmarks", - "pallet-multisig/runtime-benchmarks", - "pallet-proxy/runtime-benchmarks", - "pallet-session/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", - "pallet-transaction-payment/runtime-benchmarks", - "pallet-utility/runtime-benchmarks", - "pallet-xcm-benchmarks/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", - "parachains-common/runtime-benchmarks", - "polkadot-parachain-primitives/runtime-benchmarks", - "polkadot-runtime-common/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", - "xcm-executor/runtime-benchmarks", - "xcm-runtime-apis/runtime-benchmarks", - "xcm/runtime-benchmarks", -] -try-runtime = [ - "cumulus-pallet-aura-ext/try-runtime", - "cumulus-pallet-parachain-system/try-runtime", - "cumulus-pallet-weight-reclaim/try-runtime", - "cumulus-pallet-xcm/try-runtime", - "cumulus-pallet-xcmp-queue/try-runtime", - "frame-executive/try-runtime", - "frame-support/try-runtime", - "frame-system/try-runtime", - "frame-try-runtime/try-runtime", - "pallet-aura/try-runtime", - "pallet-authorship/try-runtime", - "pallet-balances/try-runtime", - "pallet-collator-selection/try-runtime", - "pallet-identity/try-runtime", - "pallet-message-queue/try-runtime", - "pallet-migrations/try-runtime", - "pallet-multisig/try-runtime", - "pallet-proxy/try-runtime", - "pallet-session/try-runtime", - "pallet-timestamp/try-runtime", - "pallet-transaction-payment/try-runtime", - "pallet-utility/try-runtime", - "pallet-xcm/try-runtime", - "parachain-info/try-runtime", - "parachains-common/try-runtime", - "polkadot-runtime-common/try-runtime", - "sp-runtime/try-runtime", -] - -# A feature that should be enabled when the runtime should be built for on-chain -# deployment. This will disable stuff that shouldn't be part of the on-chain wasm -# to make it smaller, like logging for example. -on-chain-release-build = [] diff --git a/cumulus/parachains/runtimes/people/people-rococo/build.rs b/cumulus/parachains/runtimes/people/people-rococo/build.rs deleted file mode 100644 index 60f8a125129ff..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/build.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#[cfg(feature = "std")] -fn main() { - substrate_wasm_builder::WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() - .build() -} - -#[cfg(not(feature = "std"))] -fn main() {} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/genesis_config_presets.rs b/cumulus/parachains/runtimes/people/people-rococo/src/genesis_config_presets.rs deleted file mode 100644 index 312262d41a9f7..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/genesis_config_presets.rs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! # People Rococo Runtime genesis config presets - -use crate::*; -use alloc::{vec, vec::Vec}; -use cumulus_primitives_core::ParaId; -use frame_support::build_struct_json_patch; -use parachains_common::{AccountId, AuraId}; -use sp_genesis_builder::PresetId; -use sp_keyring::Sr25519Keyring; -use testnet_parachains_constants::rococo::{currency::UNITS as ROC, xcm_version::SAFE_XCM_VERSION}; - -const PEOPLE_ROCOCO_ED: Balance = ExistentialDeposit::get(); -const PEOPLE_PARA_ID: ParaId = ParaId::new(1004); - -fn people_rococo_genesis( - invulnerables: Vec<(AccountId, AuraId)>, - endowed_accounts: Vec, - endowment: Balance, - id: ParaId, -) -> serde_json::Value { - build_struct_json_patch!(RuntimeGenesisConfig { - balances: BalancesConfig { - balances: endowed_accounts.iter().cloned().map(|k| (k, endowment)).collect(), - }, - parachain_info: ParachainInfoConfig { parachain_id: id }, - collator_selection: CollatorSelectionConfig { - invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), - candidacy_bond: PEOPLE_ROCOCO_ED * 16, - }, - session: SessionConfig { - keys: invulnerables - .into_iter() - .map(|(acc, aura)| { - ( - acc.clone(), // account id - acc, // validator id - SessionKeys { aura }, // session keys - ) - }) - .collect(), - }, - polkadot_xcm: PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION) }, - }) -} - -/// Provides the JSON representation of predefined genesis config for given `id`. -pub fn get_preset(id: &PresetId) -> Option> { - let patch = match id.as_ref() { - sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET => people_rococo_genesis( - // initial collators. - vec![ - (Sr25519Keyring::Alice.to_account_id(), Sr25519Keyring::Alice.public().into()), - (Sr25519Keyring::Bob.to_account_id(), Sr25519Keyring::Bob.public().into()), - ], - Sr25519Keyring::well_known().map(|x| x.to_account_id()).collect(), - ROC * 1_000_000, - PEOPLE_PARA_ID, - ), - sp_genesis_builder::DEV_RUNTIME_PRESET => people_rococo_genesis( - // initial collators. - vec![(Sr25519Keyring::Alice.to_account_id(), Sr25519Keyring::Alice.public().into())], - vec![ - Sr25519Keyring::Alice.to_account_id(), - Sr25519Keyring::Bob.to_account_id(), - Sr25519Keyring::AliceStash.to_account_id(), - Sr25519Keyring::BobStash.to_account_id(), - ], - ROC * 1_000_000, - PEOPLE_PARA_ID, - ), - _ => return None, - }; - - Some( - serde_json::to_string(&patch) - .expect("serialization to json is expected to work. qed.") - .into_bytes(), - ) -} - -/// List of supported presets. -pub fn preset_names() -> Vec { - vec![ - PresetId::from(sp_genesis_builder::DEV_RUNTIME_PRESET), - PresetId::from(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET), - ] -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs b/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs deleted file mode 100644 index 6bca7ae65a65e..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/lib.rs +++ /dev/null @@ -1,1131 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#![cfg_attr(not(feature = "std"), no_std)] -#![recursion_limit = "256"] -#[cfg(feature = "std")] -include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); - -mod genesis_config_presets; -pub mod people; -mod weights; -pub mod xcm_config; - -extern crate alloc; - -use alloc::{vec, vec::Vec}; -use codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen}; -use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; -use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; -use frame_support::{ - construct_runtime, derive_impl, - dispatch::DispatchClass, - genesis_builder_helper::{build_state, get_preset}, - parameter_types, - traits::{ - ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything, InstanceFilter, - TransformOrigin, - }, - weights::{ConstantMultiplier, Weight}, - PalletId, -}; -use frame_system::{ - limits::{BlockLength, BlockWeights}, - EnsureRoot, -}; -use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; -use parachains_common::{ - impls::DealWithFees, - message_queue::{NarrowOriginToSibling, ParaIdToSibling}, - AccountId, Balance, BlockNumber, Hash, Header, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, - NORMAL_DISPATCH_RATIO, -}; -use polkadot_runtime_common::{identity_migrator, BlockHashCount, SlowAdjustingFeeUpdate}; -use sp_api::impl_runtime_apis; -pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; -use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; -#[cfg(any(feature = "std", test))] -pub use sp_runtime::BuildStorage; -use sp_runtime::{ - generic, impl_opaque_keys, - traits::{BlakeTwo256, Block as BlockT}, - transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, -}; -pub use sp_runtime::{MultiAddress, Perbill, Permill}; -#[cfg(feature = "std")] -use sp_version::NativeVersion; -use sp_version::RuntimeVersion; -use testnet_parachains_constants::rococo::{consensus::*, currency::*, fee::WeightToFee, time::*}; -use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; -use xcm::{prelude::*, Version as XcmVersion}; -use xcm_config::{ - FellowshipLocation, GovernanceLocation, PriceForSiblingParachainDelivery, XcmConfig, - XcmOriginToTransactDispatchOrigin, -}; -use xcm_runtime_apis::{ - dry_run::{CallDryRunEffects, Error as XcmDryRunApiError, XcmDryRunEffects}, - fees::Error as XcmPaymentApiError, -}; - -/// The address format for describing accounts. -pub type Address = MultiAddress; - -/// Block type as expected by this runtime. -pub type Block = generic::Block; - -/// A Block signed with an [`sp_runtime::Justification`]. -pub type SignedBlock = generic::SignedBlock; - -/// BlockId type as expected by this runtime. -pub type BlockId = generic::BlockId; - -/// The TransactionExtension to the basic transaction logic. -pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim< - Runtime, - ( - frame_system::AuthorizeCall, - frame_system::CheckNonZeroSender, - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_transaction_payment::ChargeTransactionPayment, - ), ->; - -/// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = - generic::UncheckedExtrinsic; - -/// Migrations to apply on runtime upgrade. -pub type Migrations = ( - pallet_collator_selection::migration::v2::MigrationToV2, - cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, - pallet_session::migrations::v1::MigrateV0ToV1< - Runtime, - pallet_session::migrations::v1::InitOffenceSeverity, - >, - // permanent - pallet_xcm::migration::MigrateToLatestXcmVersion, - cumulus_pallet_aura_ext::migration::MigrateV0ToV1, -); - -/// Executive: handles dispatch to the various modules. -pub type Executive = frame_executive::Executive< - Runtime, - Block, - frame_system::ChainContext, - Runtime, - AllPalletsWithSystem, ->; - -impl_opaque_keys! { - pub struct SessionKeys { - pub aura: Aura, - } -} - -#[sp_version::runtime_version] -pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: alloc::borrow::Cow::Borrowed("people-rococo"), - impl_name: alloc::borrow::Cow::Borrowed("people-rococo"), - authoring_version: 1, - spec_version: 1_020_001, - impl_version: 0, - apis: RUNTIME_API_VERSIONS, - transaction_version: 1, - system_version: 1, -}; - -/// The version information used to identify this runtime when compiled natively. -#[cfg(feature = "std")] -pub fn native_version() -> NativeVersion { - NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } -} - -parameter_types! { - pub const Version: RuntimeVersion = VERSION; - pub RuntimeBlockLength: BlockLength = - BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); - pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() - .base_block(BlockExecutionWeight::get()) - .for_class(DispatchClass::all(), |weights| { - weights.base_extrinsic = ExtrinsicBaseWeight::get(); - }) - .for_class(DispatchClass::Normal, |weights| { - weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); - }) - .for_class(DispatchClass::Operational, |weights| { - weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); - // Operational transactions have some extra reserved space, so that they - // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. - weights.reserved = Some( - MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT - ); - }) - .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) - .build_or_panic(); - pub const SS58Prefix: u8 = 42; -} - -#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig)] -impl frame_system::Config for Runtime { - type BaseCallFilter = Everything; - type BlockWeights = RuntimeBlockWeights; - type BlockLength = RuntimeBlockLength; - type AccountId = AccountId; - type Nonce = Nonce; - type Hash = Hash; - type Block = Block; - type BlockHashCount = BlockHashCount; - type DbWeight = RocksDbWeight; - type Version = Version; - type AccountData = pallet_balances::AccountData; - type SystemWeightInfo = weights::frame_system::WeightInfo; - type ExtensionsWeightInfo = weights::frame_system_extensions::WeightInfo; - type SS58Prefix = SS58Prefix; - type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; - type MaxConsumers = ConstU32<16>; - type MultiBlockMigrator = MultiBlockMigrations; - type SingleBlockMigrations = Migrations; -} - -impl cumulus_pallet_weight_reclaim::Config for Runtime { - type WeightInfo = weights::cumulus_pallet_weight_reclaim::WeightInfo; -} - -impl pallet_timestamp::Config for Runtime { - /// A timestamp: milliseconds since the unix epoch. - type Moment = u64; - type OnTimestampSet = Aura; - type MinimumPeriod = ConstU64<0>; - type WeightInfo = weights::pallet_timestamp::WeightInfo; -} - -impl pallet_authorship::Config for Runtime { - type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type EventHandler = (CollatorSelection,); -} - -parameter_types! { - pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; -} - -impl pallet_balances::Config for Runtime { - type Balance = Balance; - type DustRemoval = (); - type RuntimeEvent = RuntimeEvent; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = weights::pallet_balances::WeightInfo; - type MaxLocks = ConstU32<50>; - type MaxReserves = ConstU32<50>; - type ReserveIdentifier = [u8; 8]; - type RuntimeFreezeReason = RuntimeFreezeReason; - type RuntimeHoldReason = RuntimeHoldReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; - type DoneSlashHandler = (); -} - -parameter_types! { - /// Relay Chain `TransactionByteFee` / 10. - pub const TransactionByteFee: Balance = MILLICENTS; -} - -impl pallet_transaction_payment::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type OnChargeTransaction = - pallet_transaction_payment::FungibleAdapter>; - type OperationalFeeMultiplier = ConstU8<5>; - type WeightToFee = WeightToFee; - type LengthToFee = ConstantMultiplier; - type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; - type WeightInfo = weights::pallet_transaction_payment::WeightInfo; -} - -parameter_types! { - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); - pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; -} - -impl cumulus_pallet_parachain_system::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type OnSystemEvent = (); - type SelfParaId = parachain_info::Pallet; - type OutboundXcmpMessageSource = XcmpQueue; - type DmpQueue = frame_support::traits::EnqueueWithOrigin; - type ReservedDmpWeight = ReservedDmpWeight; - type XcmpMessageHandler = XcmpQueue; - type ReservedXcmpWeight = ReservedXcmpWeight; - type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; - type ConsensusHook = ConsensusHook; - type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo; - type RelayParentOffset = ConstU32<0>; -} - -type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< - Runtime, - RELAY_CHAIN_SLOT_DURATION_MILLIS, - BLOCK_PROCESSING_VELOCITY, - UNINCLUDED_SEGMENT_CAPACITY, ->; - -parameter_types! { - pub MessageQueueServiceWeight: Weight = - Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; -} - -impl pallet_message_queue::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - #[cfg(feature = "runtime-benchmarks")] - type MessageProcessor = pallet_message_queue::mock_helpers::NoopMessageProcessor< - cumulus_primitives_core::AggregateMessageOrigin, - >; - #[cfg(not(feature = "runtime-benchmarks"))] - type MessageProcessor = xcm_builder::ProcessXcmMessage< - AggregateMessageOrigin, - xcm_executor::XcmExecutor, - RuntimeCall, - >; - type Size = u32; - // The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin: - type QueueChangeHandler = NarrowOriginToSibling; - type QueuePausedQuery = NarrowOriginToSibling; - type HeapSize = sp_core::ConstU32<{ 103 * 1024 }>; - type MaxStale = sp_core::ConstU32<8>; - type ServiceWeight = MessageQueueServiceWeight; - type IdleMaxServiceWeight = MessageQueueServiceWeight; - type WeightInfo = weights::pallet_message_queue::WeightInfo; -} - -impl parachain_info::Config for Runtime {} - -impl cumulus_pallet_aura_ext::Config for Runtime {} - -parameter_types! { - // Fellows pluralistic body. - pub const FellowsBodyId: BodyId = BodyId::Technical; -} - -/// Privileged origin that represents Root or Fellows pluralistic body. -pub type RootOrFellows = EitherOfDiverse< - EnsureRoot, - EnsureXcm>, ->; - -impl cumulus_pallet_xcmp_queue::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type ChannelInfo = ParachainSystem; - type VersionWrapper = PolkadotXcm; - type XcmpQueue = TransformOrigin; - type MaxInboundSuspended = ConstU32<1_000>; - type MaxActiveOutboundChannels = ConstU32<128>; - // Most on-chain HRMP channels are configured to use 102400 bytes of max message size, so we - // need to set the page size larger than that until we reduce the channel size on-chain. - type MaxPageSize = ConstU32<{ 103 * 1024 }>; - type ControllerOrigin = RootOrFellows; - type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; - type PriceForSiblingDelivery = PriceForSiblingParachainDelivery; - type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; -} - -impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime { - // This must be the same as the `ChannelInfo` from the `Config`: - type ChannelList = ParachainSystem; -} - -pub const PERIOD: u32 = 6 * HOURS; -pub const OFFSET: u32 = 0; - -impl pallet_session::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type ValidatorId = ::AccountId; - // we don't have stash and controller, thus we don't need the convert as well. - type ValidatorIdOf = pallet_collator_selection::IdentityCollator; - type ShouldEndSession = pallet_session::PeriodicSessions, ConstU32>; - type NextSessionRotation = pallet_session::PeriodicSessions, ConstU32>; - type SessionManager = CollatorSelection; - // Essentially just Aura, but let's be pedantic. - type SessionHandler = ::KeyTypeIdProviders; - type Keys = SessionKeys; - type DisablingStrategy = (); - type WeightInfo = weights::pallet_session::WeightInfo; - type Currency = Balances; - type KeyDeposit = (); -} - -impl pallet_aura::Config for Runtime { - type AuthorityId = AuraId; - type DisabledValidators = (); - type MaxAuthorities = ConstU32<100_000>; - type AllowMultipleBlocksPerSlot = ConstBool; - type SlotDuration = ConstU64; -} - -parameter_types! { - pub const PotId: PalletId = PalletId(*b"PotStake"); - pub const SessionLength: BlockNumber = 6 * HOURS; - // StakingAdmin pluralistic body. - pub const StakingAdminBodyId: BodyId = BodyId::Defense; -} - -/// We allow Root and the `StakingAdmin` to execute privileged collator selection operations. -pub type CollatorSelectionUpdateOrigin = EitherOfDiverse< - EnsureRoot, - EnsureXcm>, ->; - -impl pallet_collator_selection::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Currency = Balances; - type UpdateOrigin = CollatorSelectionUpdateOrigin; - type PotId = PotId; - type MaxCandidates = ConstU32<100>; - type MinEligibleCollators = ConstU32<4>; - type MaxInvulnerables = ConstU32<20>; - // should be a multiple of session or things will get inconsistent - type KickThreshold = ConstU32; - type ValidatorId = ::AccountId; - type ValidatorIdOf = pallet_collator_selection::IdentityCollator; - type ValidatorRegistration = Session; - type WeightInfo = weights::pallet_collator_selection::WeightInfo; -} - -parameter_types! { - // One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes. - pub const DepositBase: Balance = deposit(1, 88); - // Additional storage item size of 32 bytes. - pub const DepositFactor: Balance = deposit(0, 32); -} - -impl pallet_multisig::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type Currency = Balances; - type DepositBase = DepositBase; - type DepositFactor = DepositFactor; - type MaxSignatories = ConstU32<100>; - type WeightInfo = weights::pallet_multisig::WeightInfo; - type BlockNumberProvider = frame_system::Pallet; -} - -/// The type used to represent the kinds of proxying allowed. -#[derive( - Copy, - Clone, - Eq, - PartialEq, - Ord, - PartialOrd, - Encode, - Decode, - DecodeWithMemTracking, - Debug, - MaxEncodedLen, - scale_info::TypeInfo, -)] -pub enum ProxyType { - /// Fully permissioned proxy. Can execute any call on behalf of _proxied_. - Any, - /// Can execute any call that does not transfer funds or assets. - NonTransfer, - /// Proxy with the ability to reject time-delay proxy announcements. - CancelProxy, - /// Proxy for all Identity pallet calls. - Identity, - /// Proxy for identity registrars. - IdentityJudgement, - /// Collator selection proxy. Can execute calls related to collator selection mechanism. - Collator, -} -impl Default for ProxyType { - fn default() -> Self { - Self::Any - } -} - -impl InstanceFilter for ProxyType { - fn filter(&self, c: &RuntimeCall) -> bool { - match self { - ProxyType::Any => true, - ProxyType::NonTransfer => !matches!( - c, - RuntimeCall::Balances { .. } | - // `request_judgement` puts up a deposit to transfer to a registrar - RuntimeCall::Identity(pallet_identity::Call::request_judgement { .. }) - ), - ProxyType::CancelProxy => matches!( - c, - RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | - RuntimeCall::Utility { .. } | - RuntimeCall::Multisig { .. } - ), - ProxyType::Identity => { - matches!( - c, - RuntimeCall::Identity { .. } | - RuntimeCall::Utility { .. } | - RuntimeCall::Multisig { .. } - ) - }, - ProxyType::IdentityJudgement => matches!( - c, - RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) | - RuntimeCall::Utility(..) | - RuntimeCall::Multisig { .. } - ), - ProxyType::Collator => matches!( - c, - RuntimeCall::CollatorSelection { .. } | - RuntimeCall::Utility { .. } | - RuntimeCall::Multisig { .. } - ), - } - } - - fn is_superset(&self, o: &Self) -> bool { - match (self, o) { - (x, y) if x == y => true, - (ProxyType::Any, _) => true, - (_, ProxyType::Any) => false, - (ProxyType::Identity, ProxyType::IdentityJudgement) => true, - (ProxyType::NonTransfer, ProxyType::IdentityJudgement) => true, - (ProxyType::NonTransfer, ProxyType::Collator) => true, - _ => false, - } - } -} - -parameter_types! { - // One storage item; key size 32, value size 8. - pub const ProxyDepositBase: Balance = deposit(1, 40); - // Additional storage item size of 33 bytes. - pub const ProxyDepositFactor: Balance = deposit(0, 33); - pub const MaxProxies: u16 = 32; - // One storage item; key size 32, value size 16. - pub const AnnouncementDepositBase: Balance = deposit(1, 48); - pub const AnnouncementDepositFactor: Balance = deposit(0, 66); - pub const MaxPending: u16 = 32; -} - -impl pallet_proxy::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type Currency = Balances; - type ProxyType = ProxyType; - type ProxyDepositBase = ProxyDepositBase; - type ProxyDepositFactor = ProxyDepositFactor; - type MaxProxies = MaxProxies; - type WeightInfo = weights::pallet_proxy::WeightInfo; - type MaxPending = MaxPending; - type CallHasher = BlakeTwo256; - type AnnouncementDepositBase = AnnouncementDepositBase; - type AnnouncementDepositFactor = AnnouncementDepositFactor; - type BlockNumberProvider = frame_system::Pallet; -} - -impl pallet_utility::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type PalletsOrigin = OriginCaller; - type WeightInfo = weights::pallet_utility::WeightInfo; -} - -// To be removed after migration is complete. -impl identity_migrator::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Reaper = EnsureRoot; - type ReapIdentityHandler = (); - type WeightInfo = weights::polkadot_runtime_common_identity_migrator::WeightInfo; -} - -parameter_types! { - pub MbmServiceWeight: Weight = Perbill::from_percent(80) * RuntimeBlockWeights::get().max_block; -} - -impl pallet_migrations::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - #[cfg(not(feature = "runtime-benchmarks"))] - type Migrations = pallet_identity::migration::v2::LazyMigrationV1ToV2; - // Benchmarks need mocked migrations to guarantee that they succeed. - #[cfg(feature = "runtime-benchmarks")] - type Migrations = pallet_migrations::mock_helpers::MockedMigrations; - type CursorMaxLen = ConstU32<65_536>; - type IdentifierMaxLen = ConstU32<256>; - type MigrationStatusHandler = (); - type FailedMigrationHandler = frame_support::migrations::FreezeChainOnFailedMigration; - type MaxServiceWeight = MbmServiceWeight; - type WeightInfo = weights::pallet_migrations::WeightInfo; -} - -// Create the runtime by composing the FRAME pallets that were previously configured. -construct_runtime!( - pub enum Runtime - { - // System support stuff. - System: frame_system = 0, - ParachainSystem: cumulus_pallet_parachain_system = 1, - Timestamp: pallet_timestamp = 2, - ParachainInfo: parachain_info = 3, - WeightReclaim: cumulus_pallet_weight_reclaim = 4, - - // Monetary stuff. - Balances: pallet_balances = 10, - TransactionPayment: pallet_transaction_payment = 11, - - // Collator support. The order of these 5 are important and shall not change. - Authorship: pallet_authorship = 20, - CollatorSelection: pallet_collator_selection = 21, - Session: pallet_session = 22, - Aura: pallet_aura = 23, - AuraExt: cumulus_pallet_aura_ext = 24, - - // XCM & related - XcmpQueue: cumulus_pallet_xcmp_queue = 30, - PolkadotXcm: pallet_xcm = 31, - CumulusXcm: cumulus_pallet_xcm = 32, - MessageQueue: pallet_message_queue = 34, - - // Handy utilities. - Utility: pallet_utility = 40, - Multisig: pallet_multisig = 41, - Proxy: pallet_proxy = 42, - - // The main stage. - Identity: pallet_identity = 50, - - // Migrations pallet - MultiBlockMigrations: pallet_migrations = 98, - - // To migrate deposits - IdentityMigrator: identity_migrator = 248, - } -); - -#[cfg(feature = "runtime-benchmarks")] -mod benches { - frame_benchmarking::define_benchmarks!( - // Substrate - [frame_system, SystemBench::] - [pallet_balances, Balances] - [pallet_identity, Identity] - [pallet_message_queue, MessageQueue] - [pallet_multisig, Multisig] - [pallet_proxy, Proxy] - [pallet_session, SessionBench::] - [pallet_utility, Utility] - [pallet_timestamp, Timestamp] - [pallet_migrations, MultiBlockMigrations] - [pallet_transaction_payment, TransactionPayment] - // Polkadot - [polkadot_runtime_common::identity_migrator, IdentityMigrator] - // Cumulus - [cumulus_pallet_parachain_system, ParachainSystem] - [cumulus_pallet_xcmp_queue, XcmpQueue] - [pallet_collator_selection, CollatorSelection] - // XCM - [pallet_xcm, PalletXcmExtrinsicsBenchmark::] - [pallet_xcm_benchmarks::fungible, XcmBalances] - [pallet_xcm_benchmarks::generic, XcmGeneric] - [cumulus_pallet_weight_reclaim, WeightReclaim] - ); -} - -impl_runtime_apis! { - impl sp_consensus_aura::AuraApi for Runtime { - fn slot_duration() -> sp_consensus_aura::SlotDuration { - sp_consensus_aura::SlotDuration::from_millis(SLOT_DURATION) - } - - fn authorities() -> Vec { - pallet_aura::Authorities::::get().into_inner() - } - } - - impl cumulus_primitives_core::RelayParentOffsetApi for Runtime { - fn relay_parent_offset() -> u32 { - 0 - } - } - - impl cumulus_primitives_aura::AuraUnincludedSegmentApi for Runtime { - fn can_build_upon( - included_hash: ::Hash, - slot: cumulus_primitives_aura::Slot, - ) -> bool { - ConsensusHook::can_build_upon(included_hash, slot) - } - } - - impl sp_api::Core for Runtime { - fn version() -> RuntimeVersion { - VERSION - } - - fn execute_block(block: ::LazyBlock) { - Executive::execute_block(block) - } - - fn initialize_block(header: &::Header) -> sp_runtime::ExtrinsicInclusionMode { - Executive::initialize_block(header) - } - } - - impl sp_api::Metadata for Runtime { - fn metadata() -> OpaqueMetadata { - OpaqueMetadata::new(Runtime::metadata().into()) - } - - fn metadata_at_version(version: u32) -> Option { - Runtime::metadata_at_version(version) - } - - fn metadata_versions() -> alloc::vec::Vec { - Runtime::metadata_versions() - } - } - - impl sp_block_builder::BlockBuilder for Runtime { - fn apply_extrinsic(extrinsic: ::Extrinsic) -> ApplyExtrinsicResult { - Executive::apply_extrinsic(extrinsic) - } - - fn finalize_block() -> ::Header { - Executive::finalize_block() - } - - fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<::Extrinsic> { - data.create_extrinsics() - } - - fn check_inherents( - block: ::LazyBlock, - data: sp_inherents::InherentData, - ) -> sp_inherents::CheckInherentsResult { - data.check_extrinsics(&block) - } - } - - impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { - fn validate_transaction( - source: TransactionSource, - tx: ::Extrinsic, - block_hash: ::Hash, - ) -> TransactionValidity { - Executive::validate_transaction(source, tx, block_hash) - } - } - - impl sp_offchain::OffchainWorkerApi for Runtime { - fn offchain_worker(header: &::Header) { - Executive::offchain_worker(header) - } - } - - impl sp_session::SessionKeys for Runtime { - fn generate_session_keys(seed: Option>) -> Vec { - SessionKeys::generate(seed) - } - - fn decode_session_keys( - encoded: Vec, - ) -> Option, KeyTypeId)>> { - SessionKeys::decode_into_raw_public_keys(&encoded) - } - } - - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Nonce { - System::account_nonce(account) - } - } - - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi for Runtime { - fn query_info( - uxt: ::Extrinsic, - len: u32, - ) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo { - TransactionPayment::query_info(uxt, len) - } - fn query_fee_details( - uxt: ::Extrinsic, - len: u32, - ) -> pallet_transaction_payment::FeeDetails { - TransactionPayment::query_fee_details(uxt, len) - } - fn query_weight_to_fee(weight: Weight) -> Balance { - TransactionPayment::weight_to_fee(weight) - } - fn query_length_to_fee(length: u32) -> Balance { - TransactionPayment::length_to_fee(length) - } - } - - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi - for Runtime - { - fn query_call_info( - call: RuntimeCall, - len: u32, - ) -> pallet_transaction_payment::RuntimeDispatchInfo { - TransactionPayment::query_call_info(call, len) - } - fn query_call_fee_details( - call: RuntimeCall, - len: u32, - ) -> pallet_transaction_payment::FeeDetails { - TransactionPayment::query_call_fee_details(call, len) - } - fn query_weight_to_fee(weight: Weight) -> Balance { - TransactionPayment::weight_to_fee(weight) - } - fn query_length_to_fee(length: u32) -> Balance { - TransactionPayment::length_to_fee(length) - } - } - - impl xcm_runtime_apis::fees::XcmPaymentApi for Runtime { - fn query_acceptable_payment_assets(xcm_version: xcm::Version) -> Result, XcmPaymentApiError> { - let acceptable_assets = vec![AssetId(xcm_config::RelayLocation::get())]; - PolkadotXcm::query_acceptable_payment_assets(xcm_version, acceptable_assets) - } - - fn query_weight_to_asset_fee(weight: Weight, asset: VersionedAssetId) -> Result { - type Trader = ::Trader; - PolkadotXcm::query_weight_to_asset_fee::(weight, asset) - } - - fn query_xcm_weight(message: VersionedXcm<()>) -> Result { - PolkadotXcm::query_xcm_weight(message) - } - - fn query_delivery_fees(destination: VersionedLocation, message: VersionedXcm<()>, asset_id: VersionedAssetId) -> Result { - type AssetExchanger = ::AssetExchanger; - PolkadotXcm::query_delivery_fees::(destination, message, asset_id) - } - } - - impl xcm_runtime_apis::dry_run::DryRunApi for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall, result_xcms_version: XcmVersion) -> Result, XcmDryRunApiError> { - PolkadotXcm::dry_run_call::(origin, call, result_xcms_version) - } - - fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm) -> Result, XcmDryRunApiError> { - PolkadotXcm::dry_run_xcm::(origin_location, xcm) - } - } - - impl xcm_runtime_apis::conversions::LocationToAccountApi for Runtime { - fn convert_location(location: VersionedLocation) -> Result< - AccountId, - xcm_runtime_apis::conversions::Error - > { - xcm_runtime_apis::conversions::LocationToAccountHelper::< - AccountId, - xcm_config::LocationToAccountId, - >::convert_location(location) - } - } - - impl cumulus_primitives_core::CollectCollationInfo for Runtime { - fn collect_collation_info(header: &::Header) -> cumulus_primitives_core::CollationInfo { - ParachainSystem::collect_collation_info(header) - } - } - - #[cfg(feature = "try-runtime")] - impl frame_try_runtime::TryRuntime for Runtime { - fn on_runtime_upgrade(checks: frame_try_runtime::UpgradeCheckSelect) -> (Weight, Weight) { - let weight = Executive::try_runtime_upgrade(checks).unwrap(); - (weight, RuntimeBlockWeights::get().max_block) - } - - fn execute_block( - block: ::LazyBlock, - state_root_check: bool, - signature_check: bool, - select: frame_try_runtime::TryStateSelect, - ) -> Weight { - // NOTE: intentional unwrap: we don't want to propagate the error backwards, and want to - // have a backtrace here. - Executive::try_execute_block(block, state_root_check, signature_check, select).unwrap() - } - } - - #[cfg(feature = "runtime-benchmarks")] - impl frame_benchmarking::Benchmark for Runtime { - fn benchmark_metadata(extra: bool) -> ( - Vec, - Vec, - ) { - use frame_benchmarking::BenchmarkList; - use frame_support::traits::StorageInfoTrait; - use frame_system_benchmarking::Pallet as SystemBench; - use cumulus_pallet_session_benchmarking::Pallet as SessionBench; - use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark; - - // This is defined once again in dispatch_benchmark, because list_benchmarks! - // and add_benchmarks! are macros exported by define_benchmarks! macros and those types - // are referenced in that call. - type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; - type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::; - - let mut list = Vec::::new(); - list_benchmarks!(list, extra); - - let storage_info = AllPalletsWithSystem::storage_info(); - (list, storage_info) - } - - #[allow(non_local_definitions)] - fn dispatch_benchmark( - config: frame_benchmarking::BenchmarkConfig - ) -> Result, alloc::string::String> { - use frame_benchmarking::{BenchmarkBatch, BenchmarkError}; - use sp_storage::TrackedStorageKey; - - use frame_system_benchmarking::Pallet as SystemBench; - impl frame_system_benchmarking::Config for Runtime { - fn setup_set_code_requirements(code: &alloc::vec::Vec) -> Result<(), BenchmarkError> { - ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32); - Ok(()) - } - - fn verify_set_code() { - System::assert_last_event(cumulus_pallet_parachain_system::Event::::ValidationFunctionStored.into()); - } - } - - use cumulus_pallet_session_benchmarking::Pallet as SessionBench; - impl cumulus_pallet_session_benchmarking::Config for Runtime {} - use testnet_parachains_constants::rococo::locations::{AssetHubParaId, AssetHubLocation}; - - use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark; - impl pallet_xcm::benchmarking::Config for Runtime { - type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - PriceForSiblingParachainDelivery, - AssetHubParaId, - ParachainSystem - >; - - fn reachable_dest() -> Option { - Some(AssetHubLocation::get()) - } - - fn teleportable_asset_and_dest() -> Option<(Asset, Location)> { - // Relay/native token can be teleported between People and Relay. - Some(( - Asset { - fun: Fungible(ExistentialDeposit::get()), - id: AssetId(RelayLocation::get()) - }, - AssetHubLocation::get(), - )) - } - - fn reserve_transferable_asset_and_dest() -> Option<(Asset, Location)> { - None - } - - fn set_up_complex_asset_transfer() -> Option<(Assets, u32, Location, alloc::boxed::Box)> { - let native_location = Parent.into(); - let dest = AssetHubLocation::get(); - - pallet_xcm::benchmarking::helpers::native_teleport_as_asset_transfer::( - native_location, - dest, - ) - } - - fn get_asset() -> Asset { - Asset { - id: AssetId(RelayLocation::get()), - fun: Fungible(ExistentialDeposit::get()), - } - } - } - - use xcm::latest::prelude::*; - use xcm_config::RelayLocation; - - parameter_types! { - pub ExistentialDepositAsset: Option = Some(( - RelayLocation::get(), - ExistentialDeposit::get() - ).into()); - } - - impl pallet_xcm_benchmarks::Config for Runtime { - type XcmConfig = XcmConfig; - type AccountIdConverter = xcm_config::LocationToAccountId; - type DeliveryHelper = polkadot_runtime_common::xcm_sender::ToParachainDeliveryHelper< - xcm_config::XcmConfig, - ExistentialDepositAsset, - PriceForSiblingParachainDelivery, - AssetHubParaId, - ParachainSystem, - >; - fn valid_destination() -> Result { - Ok(AssetHubLocation::get()) - } - fn worst_case_holding(_depositable_count: u32) -> Assets { - // just concrete assets according to relay chain. - let assets: Vec = vec![ - Asset { - id: AssetId(RelayLocation::get()), - fun: Fungible(1_000_000 * UNITS), - } - ]; - assets.into() - } - } - - parameter_types! { - pub TrustedTeleporter: Option<(Location, Asset)> = Some(( - AssetHubLocation::get(), - Asset { fun: Fungible(UNITS), id: AssetId(RelayLocation::get()) }, - )); - pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; - pub const TrustedReserve: Option<(Location, Asset)> = None; - } - - impl pallet_xcm_benchmarks::fungible::Config for Runtime { - type TransactAsset = Balances; - - type CheckedAccount = CheckedAccount; - type TrustedTeleporter = TrustedTeleporter; - type TrustedReserve = TrustedReserve; - - fn get_asset() -> Asset { - Asset { - id: AssetId(RelayLocation::get()), - fun: Fungible(UNITS), - } - } - } - - impl pallet_xcm_benchmarks::generic::Config for Runtime { - type RuntimeCall = RuntimeCall; - type TransactAsset = Balances; - - fn worst_case_response() -> (u64, Response) { - (0u64, Response::Version(Default::default())) - } - - fn worst_case_asset_exchange() -> Result<(Assets, Assets), BenchmarkError> { - Err(BenchmarkError::Skip) - } - - fn universal_alias() -> Result<(Location, Junction), BenchmarkError> { - Err(BenchmarkError::Skip) - } - - fn transact_origin_and_runtime_call() -> Result<(Location, RuntimeCall), BenchmarkError> { - Ok((AssetHubLocation::get(), frame_system::Call::remark_with_event { remark: vec![] }.into())) - } - - fn subscribe_origin() -> Result { - Ok(AssetHubLocation::get()) - } - - fn claimable_asset() -> Result<(Location, Location, Assets), BenchmarkError> { - let origin = AssetHubLocation::get(); - let assets: Assets = (AssetId(RelayLocation::get()), 1_000 * UNITS).into(); - let ticket = Location::new(0, []); - Ok((origin, ticket, assets)) - } - - fn worst_case_for_trader() -> Result<(Asset, WeightLimit), BenchmarkError> { - Ok((Asset { - id: AssetId(RelayLocation::get()), - fun: Fungible(1_000_000 * UNITS), - }, WeightLimit::Limited(Weight::from_parts(5000, 5000)))) - } - - fn unlockable_asset() -> Result<(Location, Location, Asset), BenchmarkError> { - Err(BenchmarkError::Skip) - } - - fn export_message_origin_and_destination( - ) -> Result<(Location, NetworkId, InteriorLocation), BenchmarkError> { - Err(BenchmarkError::Skip) - } - - fn alias_origin() -> Result<(Location, Location), BenchmarkError> { - Err(BenchmarkError::Skip) - } - } - - type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::; - type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::; - - use frame_support::traits::WhitelistedStorageKeys; - let whitelist: Vec = AllPalletsWithSystem::whitelisted_storage_keys(); - - let mut batches = Vec::::new(); - let params = (&config, &whitelist); - add_benchmarks!(params, batches); - - Ok(batches) - } - } - - impl sp_genesis_builder::GenesisBuilder for Runtime { - fn build_state(config: Vec) -> sp_genesis_builder::Result { - build_state::(config) - } - - fn get_preset(id: &Option) -> Option> { - get_preset::(id, &genesis_config_presets::get_preset) - } - - fn preset_names() -> Vec { - genesis_config_presets::preset_names() - } - } - - impl xcm_runtime_apis::trusted_query::TrustedQueryApi for Runtime { - fn is_trusted_reserve(asset: VersionedAsset, location: VersionedLocation) -> xcm_runtime_apis::trusted_query::XcmTrustedQueryResult { - PolkadotXcm::is_trusted_reserve(asset, location) - } - fn is_trusted_teleporter(asset: VersionedAsset, location: VersionedLocation) -> xcm_runtime_apis::trusted_query::XcmTrustedQueryResult { - PolkadotXcm::is_trusted_teleporter(asset, location) - } - } - - impl cumulus_primitives_core::GetParachainInfo for Runtime { - fn parachain_id() -> ParaId { - ParachainInfo::parachain_id() - } - } - - impl cumulus_primitives_core::TargetBlockRate for Runtime { - fn target_block_rate() -> u32 { - 1 - } - } -} - -cumulus_pallet_parachain_system::register_validate_block! { - Runtime = Runtime, - BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/people.rs b/cumulus/parachains/runtimes/people/people-rococo/src/people.rs deleted file mode 100644 index 18bde8dc04fec..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/people.rs +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use super::*; -use crate::xcm_config::LocationToAccountId; -use codec::{Decode, Encode, MaxEncodedLen}; -use enumflags2::{bitflags, BitFlags}; -use frame_support::{ - parameter_types, traits::ConstU32, CloneNoBound, DebugNoBound, EqNoBound, PartialEqNoBound, -}; -use pallet_identity::{Data, IdentityInformationProvider}; -use parachains_common::{impls::ToParentTreasury, DAYS}; -use scale_info::TypeInfo; -use sp_runtime::{ - traits::{AccountIdConversion, Verify}, - Debug, -}; - -parameter_types! { - // 27 | Min encoded size of `Registration` - // - 10 | Min encoded size of `IdentityInfo` - // -----| - // 17 | Min size without `IdentityInfo` (accounted for in byte deposit) - pub const BasicDeposit: Balance = deposit(1, 17); - pub const ByteDeposit: Balance = deposit(0, 1); - pub const UsernameDeposit: Balance = deposit(0, 32); - pub const SubAccountDeposit: Balance = deposit(1, 53); - pub RelayTreasuryAccount: AccountId = - parachains_common::TREASURY_PALLET_ID.into_account_truncating(); -} - -impl pallet_identity::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Currency = Balances; - type BasicDeposit = BasicDeposit; - type ByteDeposit = ByteDeposit; - type UsernameDeposit = UsernameDeposit; - type SubAccountDeposit = SubAccountDeposit; - type MaxSubAccounts = ConstU32<100>; - type IdentityInformation = IdentityInfo; - type MaxRegistrars = ConstU32<20>; - type Slashed = ToParentTreasury; - type ForceOrigin = EnsureRoot; - type RegistrarOrigin = EnsureRoot; - type OffchainSignature = Signature; - type SigningPublicKey = ::Signer; - type UsernameAuthorityOrigin = EnsureRoot; - type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>; - type UsernameGracePeriod = ConstU32<{ 3 * DAYS }>; - type MaxSuffixLength = ConstU32<7>; - type MaxUsernameLength = ConstU32<32>; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = (); - type WeightInfo = weights::pallet_identity::WeightInfo; -} - -/// The fields that we use to identify the owner of an account with. Each corresponds to a field -/// in the `IdentityInfo` struct. -#[bitflags] -#[repr(u64)] -#[derive(Clone, Copy, PartialEq, Eq, Debug)] -pub enum IdentityField { - Display, - Legal, - Web, - Matrix, - Email, - PgpFingerprint, - Image, - Twitter, - GitHub, - Discord, -} - -/// Information concerning the identity of the controller of an account. -#[derive( - CloneNoBound, - Encode, - Decode, - DecodeWithMemTracking, - EqNoBound, - MaxEncodedLen, - PartialEqNoBound, - DebugNoBound, - TypeInfo, -)] -#[codec(mel_bound())] -pub struct IdentityInfo { - /// A reasonable display name for the controller of the account. This should be whatever the - /// account is typically known as and should not be confusable with other entities, given - /// reasonable context. - /// - /// Stored as UTF-8. - pub display: Data, - - /// The full legal name in the local jurisdiction of the entity. This might be a bit - /// long-winded. - /// - /// Stored as UTF-8. - pub legal: Data, - - /// A representative website held by the controller of the account. - /// - /// NOTE: `https://` is automatically prepended. - /// - /// Stored as UTF-8. - pub web: Data, - - /// The Matrix (e.g. for Element) handle held by the controller of the account. Previously, - /// this was called `riot`. - /// - /// Stored as UTF-8. - pub matrix: Data, - - /// The email address of the controller of the account. - /// - /// Stored as UTF-8. - pub email: Data, - - /// The PGP/GPG public key of the controller of the account. - pub pgp_fingerprint: Option<[u8; 20]>, - - /// A graphic image representing the controller of the account. Should be a company, - /// organization or project logo or a headshot in the case of a human. - pub image: Data, - - /// The Twitter identity. The leading `@` character may be elided. - pub twitter: Data, - - /// The GitHub username of the controller of the account. - pub github: Data, - - /// The Discord username of the controller of the account. - pub discord: Data, -} - -impl IdentityInformationProvider for IdentityInfo { - type FieldsIdentifier = u64; - - fn has_identity(&self, fields: Self::FieldsIdentifier) -> bool { - self.fields().bits() & fields == fields - } - - #[cfg(feature = "runtime-benchmarks")] - fn create_identity_info() -> Self { - let data = Data::Raw(alloc::vec![0; 32].try_into().unwrap()); - - IdentityInfo { - display: data.clone(), - legal: data.clone(), - web: data.clone(), - matrix: data.clone(), - email: data.clone(), - pgp_fingerprint: Some([0; 20]), - image: data.clone(), - twitter: data.clone(), - github: data.clone(), - discord: data, - } - } - - #[cfg(feature = "runtime-benchmarks")] - fn all_fields() -> Self::FieldsIdentifier { - use enumflags2::BitFlag; - IdentityField::all().bits() - } -} - -impl IdentityInfo { - pub(crate) fn fields(&self) -> BitFlags { - let mut res = >::empty(); - if !self.display.is_none() { - res.insert(IdentityField::Display); - } - if !self.legal.is_none() { - res.insert(IdentityField::Legal); - } - if !self.web.is_none() { - res.insert(IdentityField::Web); - } - if !self.matrix.is_none() { - res.insert(IdentityField::Matrix); - } - if !self.email.is_none() { - res.insert(IdentityField::Email); - } - if self.pgp_fingerprint.is_some() { - res.insert(IdentityField::PgpFingerprint); - } - if !self.image.is_none() { - res.insert(IdentityField::Image); - } - if !self.twitter.is_none() { - res.insert(IdentityField::Twitter); - } - if !self.github.is_none() { - res.insert(IdentityField::GitHub); - } - if !self.discord.is_none() { - res.insert(IdentityField::Discord); - } - res - } -} - -/// A `Default` identity. This is given to users who get a username but have not set an identity. -impl Default for IdentityInfo { - fn default() -> Self { - IdentityInfo { - display: Data::None, - legal: Data::None, - web: Data::None, - matrix: Data::None, - email: Data::None, - pgp_fingerprint: None, - image: Data::None, - twitter: Data::None, - github: Data::None, - discord: Data::None, - } - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/block_weights.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/block_weights.rs deleted file mode 100644 index 3ff2b3550fbf8..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/block_weights.rs +++ /dev/null @@ -1,53 +0,0 @@ -// This file is part of Cumulus. - -// Copyright (C) 2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -pub mod constants { - use frame_support::{ - parameter_types, - weights::{constants, Weight}, - }; - - parameter_types! { - /// Importing a block with 0 Extrinsics. - pub const BlockExecutionWeight: Weight = - Weight::from_parts(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(5_000_000), 0); - } - - #[cfg(test)] - mod test_weights { - use frame_support::weights::constants; - - /// Checks that the weight exists and is sane. - // NOTE: If this test fails but you are sure that the generated values are fine, - // you can delete it. - #[test] - fn sane() { - let w = super::constants::BlockExecutionWeight::get(); - - // At least 100 µs. - assert!( - w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS, - "Weight should be at least 100 µs." - ); - // At most 50 ms. - assert!( - w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS, - "Weight should be at most 50 ms." - ); - } - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/cumulus_pallet_parachain_system.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/cumulus_pallet_parachain_system.rs deleted file mode 100644 index 58aef8cd5ab87..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/cumulus_pallet_parachain_system.rs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `cumulus_pallet_parachain_system` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=cumulus_pallet_parachain_system -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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 `cumulus_pallet_parachain_system`. -pub struct WeightInfo(PhantomData); -impl cumulus_pallet_parachain_system::WeightInfo for WeightInfo { - /// Storage: `ParachainSystem::LastDmqMqcHead` (r:1 w:1) - /// Proof: `ParachainSystem::LastDmqMqcHead` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::ProcessedDownwardMessages` (r:0 w:1) - /// Proof: `ParachainSystem::ProcessedDownwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `MessageQueue::Pages` (r:0 w:1000) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - /// The range of component `n` is `[0, 1000]`. - fn enqueue_inbound_downward_messages(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `12` - // Estimated: `3517` - // Minimum execution time: 2_235_000 picoseconds. - Weight::from_parts(2_365_000, 0) - .saturating_add(Weight::from_parts(0, 3517)) - // Standard Error: 66_419 - .saturating_add(Weight::from_parts(334_432_921, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(4)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/cumulus_pallet_weight_reclaim.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/cumulus_pallet_weight_reclaim.rs deleted file mode 100644 index f97376ffdc43c..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/cumulus_pallet_weight_reclaim.rs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `cumulus_pallet_weight_reclaim` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=cumulus_pallet_weight_reclaim -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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 `cumulus_pallet_weight_reclaim`. -pub struct WeightInfo(PhantomData); -impl cumulus_pallet_weight_reclaim::WeightInfo for WeightInfo { - fn storage_weight_reclaim() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_983_000 picoseconds. - Weight::from_parts(4_164_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/cumulus_pallet_xcmp_queue.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/cumulus_pallet_xcmp_queue.rs deleted file mode 100644 index 8ed2bc4470d38..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/cumulus_pallet_xcmp_queue.rs +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `cumulus_pallet_xcmp_queue` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-09-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `4e9548205c14`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=cumulus_pallet_xcmp_queue -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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 `cumulus_pallet_xcmp_queue`. -pub struct WeightInfo(PhantomData); -impl cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo { - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:1) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) - fn set_config_with_u32() -> Weight { - // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `1497` - // Minimum execution time: 5_101_000 picoseconds. - Weight::from_parts(5_445_000, 0) - .saturating_add(Weight::from_parts(0, 1497)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) - /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:0 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - /// The range of component `n` is `[0, 105467]`. - fn enqueue_n_bytes_xcmp_message(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `82` - // Estimated: `5487` - // Minimum execution time: 13_691_000 picoseconds. - Weight::from_parts(9_579_858, 0) - .saturating_add(Weight::from_parts(0, 5487)) - // Standard Error: 7 - .saturating_add(Weight::from_parts(968, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) - /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:0 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - /// The range of component `n` is `[0, 1000]`. - fn enqueue_n_empty_xcmp_messages(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `82` - // Estimated: `5487` - // Minimum execution time: 11_450_000 picoseconds. - Weight::from_parts(16_374_477, 0) - .saturating_add(Weight::from_parts(0, 5487)) - // Standard Error: 185 - .saturating_add(Weight::from_parts(141_346, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `Measured`) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `Measured`) - /// Storage: `MessageQueue::Pages` (r:1 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `Measured`) - /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) - /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `Measured`) - /// The range of component `n` is `[0, 105457]`. - fn enqueue_empty_xcmp_message_at(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `264 + n * (1 ±0)` - // Estimated: `3727 + n * (1 ±0)` - // Minimum execution time: 20_584_000 picoseconds. - Weight::from_parts(12_592_313, 0) - .saturating_add(Weight::from_parts(0, 3727)) - // Standard Error: 11 - .saturating_add(Weight::from_parts(2_031, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(Weight::from_parts(0, 1).saturating_mul(n.into())) - } - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) - /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:0 w:100) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - /// The range of component `n` is `[0, 100]`. - fn enqueue_n_full_pages(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `117` - // Estimated: `5487` - // Minimum execution time: 13_072_000 picoseconds. - Weight::from_parts(13_407_000, 0) - .saturating_add(Weight::from_parts(0, 5487)) - // Standard Error: 48_045 - .saturating_add(Weight::from_parts(92_778_071, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) - } - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `Measured`) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `Measured`) - /// Storage: `MessageQueue::Pages` (r:1 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `Measured`) - /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) - /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `Measured`) - fn enqueue_1000_small_xcmp_messages() -> Weight { - // Proof Size summary in bytes: - // Measured: `52997` - // Estimated: `56462` - // Minimum execution time: 267_839_000 picoseconds. - Weight::from_parts(288_522_000, 0) - .saturating_add(Weight::from_parts(0, 56462)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - fn suspend_channel() -> Weight { - // Proof Size summary in bytes: - // Measured: `76` - // Estimated: `2767` - // Minimum execution time: 3_273_000 picoseconds. - Weight::from_parts(3_456_000, 0) - .saturating_add(Weight::from_parts(0, 2767)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - fn resume_channel() -> Weight { - // Proof Size summary in bytes: - // Measured: `111` - // Estimated: `2767` - // Minimum execution time: 4_640_000 picoseconds. - Weight::from_parts(4_888_000, 0) - .saturating_add(Weight::from_parts(0, 2767)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// The range of component `n` is `[0, 92]`. - fn take_first_concatenated_xcm(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_026_000 picoseconds. - Weight::from_parts(2_467_443, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 218 - .saturating_add(Weight::from_parts(17_664, 0).saturating_mul(n.into())) - } - /// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1) - /// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1) - /// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1) - /// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) - /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:0 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn on_idle_good_msg() -> Weight { - // Proof Size summary in bytes: - // Measured: `105647` - // Estimated: `109112` - // Minimum execution time: 175_346_000 picoseconds. - Weight::from_parts(178_900_000, 0) - .saturating_add(Weight::from_parts(0, 109112)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(5)) - } - /// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1) - /// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6b345d8e88afa015075c945637c07e8f20` (r:1 w:1) - /// Storage: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1) - /// Proof: UNKNOWN KEY `0x7b3237373ffdfeb1cab4222e3b520d6bedc49980ba3aa32b0a189290fd036649` (r:1 w:1) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::QueueConfig` (r:1 w:0) - /// Proof: `XcmpQueue::QueueConfig` (`max_values`: Some(1), `max_size`: Some(12), added: 507, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::InboundXcmpSuspended` (r:1 w:0) - /// Proof: `XcmpQueue::InboundXcmpSuspended` (`max_values`: Some(1), `max_size`: Some(4002), added: 4497, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:0 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn on_idle_large_msg() -> Weight { - // Proof Size summary in bytes: - // Measured: `65716` - // Estimated: `69181` - // Minimum execution time: 117_370_000 picoseconds. - Weight::from_parts(119_465_000, 0) - .saturating_add(Weight::from_parts(0, 69181)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(5)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/extrinsic_weights.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/extrinsic_weights.rs deleted file mode 100644 index ab951aea56150..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/extrinsic_weights.rs +++ /dev/null @@ -1,53 +0,0 @@ -// This file is part of Cumulus. - -// Copyright (C) 2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -pub mod constants { - use frame_support::{ - parameter_types, - weights::{constants, Weight}, - }; - - parameter_types! { - /// Executing a NO-OP `System::remarks` Extrinsic. - pub const ExtrinsicBaseWeight: Weight = - Weight::from_parts(constants::WEIGHT_REF_TIME_PER_NANOS.saturating_mul(125_000), 0); - } - - #[cfg(test)] - mod test_weights { - use frame_support::weights::constants; - - /// Checks that the weight exists and is sane. - // NOTE: If this test fails but you are sure that the generated values are fine, - // you can delete it. - #[test] - fn sane() { - let w = super::constants::ExtrinsicBaseWeight::get(); - - // At least 10 µs. - assert!( - w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS, - "Weight should be at least 10 µs." - ); - // At most 1 ms. - assert!( - w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, - "Weight should be at most 1 ms." - ); - } - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/frame_system.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/frame_system.rs deleted file mode 100644 index 794f81dcb8f28..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/frame_system.rs +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `frame_system` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=frame_system -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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 `frame_system`. -pub struct WeightInfo(PhantomData); -impl frame_system::WeightInfo for WeightInfo { - /// The range of component `b` is `[0, 3932160]`. - fn remark(b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_085_000 picoseconds. - Weight::from_parts(2_147_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 120 - .saturating_add(Weight::from_parts(10_681, 0).saturating_mul(b.into())) - } - /// The range of component `b` is `[0, 3932160]`. - fn remark_with_event(b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_538_000 picoseconds. - Weight::from_parts(5_833_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 120 - .saturating_add(Weight::from_parts(12_003, 0).saturating_mul(b.into())) - } - /// Storage: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1) - /// Proof: UNKNOWN KEY `0x3a686561707061676573` (r:0 w:1) - fn set_heap_pages() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_260_000 picoseconds. - Weight::from_parts(3_516_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) - /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) - /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpgradeRestrictionSignal` (r:1 w:0) - /// Proof: `ParachainSystem::UpgradeRestrictionSignal` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingValidationCode` (r:1 w:1) - /// Proof: `ParachainSystem::PendingValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::NewValidationCode` (r:0 w:1) - /// Proof: `ParachainSystem::NewValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::DidSetValidationCode` (r:0 w:1) - /// Proof: `ParachainSystem::DidSetValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn set_code() -> Weight { - // Proof Size summary in bytes: - // Measured: `169` - // Estimated: `67035` - // Minimum execution time: 160_743_369_000 picoseconds. - Weight::from_parts(164_022_588_000, 0) - .saturating_add(Weight::from_parts(0, 67035)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `i` is `[0, 1000]`. - fn set_storage(i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_082_000 picoseconds. - Weight::from_parts(2_202_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 2_221 - .saturating_add(Weight::from_parts(715_536, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `i` is `[0, 1000]`. - fn kill_storage(i: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_076_000 picoseconds. - Weight::from_parts(2_148_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 880 - .saturating_add(Weight::from_parts(554_607, 0).saturating_mul(i.into())) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(i.into()))) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `p` is `[0, 1000]`. - fn kill_prefix(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `82 + p * (69 ±0)` - // Estimated: `78 + p * (70 ±0)` - // Minimum execution time: 4_139_000 picoseconds. - Weight::from_parts(4_248_000, 0) - .saturating_add(Weight::from_parts(0, 78)) - // Standard Error: 1_318 - .saturating_add(Weight::from_parts(1_312_979, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(p.into()))) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - .saturating_add(Weight::from_parts(0, 70).saturating_mul(p.into())) - } - /// Storage: `System::AuthorizedUpgrade` (r:0 w:1) - /// Proof: `System::AuthorizedUpgrade` (`max_values`: Some(1), `max_size`: Some(33), added: 528, mode: `MaxEncodedLen`) - fn authorize_upgrade() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 10_114_000 picoseconds. - Weight::from_parts(10_379_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::AuthorizedUpgrade` (r:1 w:1) - /// Proof: `System::AuthorizedUpgrade` (`max_values`: Some(1), `max_size`: Some(33), added: 528, mode: `MaxEncodedLen`) - /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) - /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) - /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::UpgradeRestrictionSignal` (r:1 w:0) - /// Proof: `ParachainSystem::UpgradeRestrictionSignal` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::PendingValidationCode` (r:1 w:1) - /// Proof: `ParachainSystem::PendingValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0) - /// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::NewValidationCode` (r:0 w:1) - /// Proof: `ParachainSystem::NewValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::DidSetValidationCode` (r:0 w:1) - /// Proof: `ParachainSystem::DidSetValidationCode` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn apply_authorized_upgrade() -> Weight { - // Proof Size summary in bytes: - // Measured: `191` - // Estimated: `67035` - // Minimum execution time: 163_855_657_000 picoseconds. - Weight::from_parts(166_326_130_000, 0) - .saturating_add(Weight::from_parts(0, 67035)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/frame_system_extensions.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/frame_system_extensions.rs deleted file mode 100644 index 854af60e5679b..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/frame_system_extensions.rs +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// This file is part of Cumulus. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `frame_system_extensions` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-12-21, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `gleipnir`, CPU: `AMD Ryzen 9 7900X 12-Core Processor` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("people-rococo-dev")`, DB CACHE: 1024 - -// Executed Command: -// ./target/release/polkadot-parachain -// benchmark -// pallet -// --wasm-execution=compiled -// --pallet=frame_system_extensions -// --no-storage-info -// --no-median-slopes -// --no-min-squares -// --extrinsic=* -// --steps=2 -// --repeat=2 -// --json -// --header=./cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights/ -// --chain=people-rococo-dev - -#![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 `frame_system_extensions`. -pub struct WeightInfo(PhantomData); -impl frame_system::ExtensionsWeightInfo for WeightInfo { - /// Storage: `System::BlockHash` (r:1 w:0) - /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - fn check_genesis() -> Weight { - // Proof Size summary in bytes: - // Measured: `54` - // Estimated: `3509` - // Minimum execution time: 3_637_000 picoseconds. - Weight::from_parts(6_382_000, 0) - .saturating_add(Weight::from_parts(0, 3509)) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: `System::BlockHash` (r:1 w:0) - /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - fn check_mortality_mortal_transaction() -> Weight { - // Proof Size summary in bytes: - // Measured: `92` - // Estimated: `3509` - // Minimum execution time: 5_841_000 picoseconds. - Weight::from_parts(8_776_000, 0) - .saturating_add(Weight::from_parts(0, 3509)) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: `System::BlockHash` (r:1 w:0) - /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - fn check_mortality_immortal_transaction() -> Weight { - // Proof Size summary in bytes: - // Measured: `92` - // Estimated: `3509` - // Minimum execution time: 5_841_000 picoseconds. - Weight::from_parts(8_776_000, 0) - .saturating_add(Weight::from_parts(0, 3509)) - .saturating_add(T::DbWeight::get().reads(1)) - } - fn check_non_zero_sender() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 561_000 picoseconds. - Weight::from_parts(2_705_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn check_nonce() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_316_000 picoseconds. - Weight::from_parts(5_771_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn check_spec_version() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 511_000 picoseconds. - Weight::from_parts(2_575_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn check_tx_version() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 501_000 picoseconds. - Weight::from_parts(2_595_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `System::AllExtrinsicsLen` (r:1 w:1) - /// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `System::BlockWeight` (r:1 w:1) - /// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) - fn check_weight() -> Weight { - // Proof Size summary in bytes: - // Measured: `24` - // Estimated: `1533` - // Minimum execution time: 3_687_000 picoseconds. - Weight::from_parts(6_192_000, 0) - .saturating_add(Weight::from_parts(0, 1533)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `System::AllExtrinsicsLen` (r:1 w:1) - /// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `System::BlockWeight` (r:1 w:1) - /// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`) - fn weight_reclaim() -> Weight { - // Proof Size summary in bytes: - // Measured: `24` - // Estimated: `1533` - // Minimum execution time: 3_687_000 picoseconds. - Weight::from_parts(6_192_000, 0) - .saturating_add(Weight::from_parts(0, 1533)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/mod.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/mod.rs deleted file mode 100644 index 81906a11fe1c9..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/mod.rs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Expose the auto generated weight files. - -pub mod block_weights; -pub mod cumulus_pallet_parachain_system; -pub mod cumulus_pallet_weight_reclaim; -pub mod cumulus_pallet_xcmp_queue; -pub mod extrinsic_weights; -pub mod frame_system; -pub mod frame_system_extensions; -pub mod pallet_balances; -pub mod pallet_collator_selection; -pub mod pallet_identity; -pub mod pallet_message_queue; -pub mod pallet_migrations; -pub mod pallet_multisig; -pub mod pallet_proxy; -pub mod pallet_session; -pub mod pallet_timestamp; -pub mod pallet_transaction_payment; -pub mod pallet_utility; -pub mod pallet_xcm; -pub mod paritydb_weights; -pub mod polkadot_runtime_common_identity_migrator; -pub mod rocksdb_weights; -pub mod xcm; - -pub use block_weights::constants::BlockExecutionWeight; -pub use extrinsic_weights::constants::ExtrinsicBaseWeight; -pub use rocksdb_weights::constants::RocksDbWeight; diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_balances.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_balances.rs deleted file mode 100644 index 9ff826775efba..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_balances.rs +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_balances` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=pallet_balances -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_balances`. -pub struct WeightInfo(PhantomData); -impl pallet_balances::WeightInfo for WeightInfo { - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn transfer_allow_death() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 49_298_000 picoseconds. - Weight::from_parts(50_120_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn transfer_keep_alive() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 39_382_000 picoseconds. - Weight::from_parts(40_010_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn force_set_balance_creating() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `3593` - // Minimum execution time: 14_405_000 picoseconds. - Weight::from_parts(14_881_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn force_set_balance_killing() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `3593` - // Minimum execution time: 21_280_000 picoseconds. - Weight::from_parts(21_777_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn force_transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `6196` - // Minimum execution time: 51_210_000 picoseconds. - Weight::from_parts(52_101_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn transfer_all() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 49_150_000 picoseconds. - Weight::from_parts(49_845_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn force_unreserve() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `3593` - // Minimum execution time: 17_103_000 picoseconds. - Weight::from_parts(17_979_000, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `System::Account` (r:999 w:999) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `u` is `[1, 1000]`. - fn upgrade_accounts(u: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0 + u * (136 ±0)` - // Estimated: `990 + u * (2603 ±0)` - // Minimum execution time: 16_856_000 picoseconds. - Weight::from_parts(17_097_000, 0) - .saturating_add(Weight::from_parts(0, 990)) - // Standard Error: 11_810 - .saturating_add(Weight::from_parts(14_844_422, 0).saturating_mul(u.into())) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into()))) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into()))) - .saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into())) - } - fn force_adjust_total_issuance() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_069_000 picoseconds. - Weight::from_parts(6_556_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn burn_allow_death() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 31_336_000 picoseconds. - Weight::from_parts(32_468_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn burn_keep_alive() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 21_911_000 picoseconds. - Weight::from_parts(22_357_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs deleted file mode 100644 index 53f8b691e1ed3..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_collator_selection.rs +++ /dev/null @@ -1,280 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_collator_selection` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=pallet_collator_selection -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_collator_selection`. -pub struct WeightInfo(PhantomData); -impl pallet_collator_selection::WeightInfo for WeightInfo { - /// Storage: `Session::NextKeys` (r:20 w:0) - /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `CollatorSelection::Invulnerables` (r:0 w:1) - /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// The range of component `b` is `[1, 20]`. - fn set_invulnerables(b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `164 + b * (79 ±0)` - // Estimated: `1155 + b * (2555 ±0)` - // Minimum execution time: 12_804_000 picoseconds. - Weight::from_parts(10_801_718, 0) - .saturating_add(Weight::from_parts(0, 1155)) - // Standard Error: 10_325 - .saturating_add(Weight::from_parts(4_052_639, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(b.into()))) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(Weight::from_parts(0, 2555).saturating_mul(b.into())) - } - /// Storage: `Session::NextKeys` (r:1 w:0) - /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `CollatorSelection::Invulnerables` (r:1 w:1) - /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::CandidateList` (r:1 w:1) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `b` is `[1, 19]`. - /// The range of component `c` is `[1, 99]`. - fn add_invulnerable(b: u32, c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `757 + b * (32 ±0) + c * (53 ±0)` - // Estimated: `6287 + b * (37 ±0) + c * (53 ±0)` - // Minimum execution time: 49_565_000 picoseconds. - Weight::from_parts(50_178_552, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 9_536 - .saturating_add(Weight::from_parts(135_081, 0).saturating_mul(b.into())) - // Standard Error: 1_807 - .saturating_add(Weight::from_parts(133_957, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(Weight::from_parts(0, 37).saturating_mul(b.into())) - .saturating_add(Weight::from_parts(0, 53).saturating_mul(c.into())) - } - /// Storage: `CollatorSelection::CandidateList` (r:1 w:0) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::Invulnerables` (r:1 w:1) - /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// The range of component `b` is `[5, 20]`. - fn remove_invulnerable(b: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `119 + b * (32 ±0)` - // Estimated: `6287` - // Minimum execution time: 13_065_000 picoseconds. - Weight::from_parts(13_170_688, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 2_279 - .saturating_add(Weight::from_parts(165_987, 0).saturating_mul(b.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `CollatorSelection::DesiredCandidates` (r:0 w:1) - /// Proof: `CollatorSelection::DesiredCandidates` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - fn set_desired_candidates() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_936_000 picoseconds. - Weight::from_parts(5_196_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `CollatorSelection::CandidacyBond` (r:1 w:1) - /// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::CandidateList` (r:1 w:1) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:100 w:100) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:100) - /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - /// The range of component `c` is `[0, 100]`. - /// The range of component `k` is `[0, 100]`. - fn set_candidacy_bond(c: u32, k: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0 + c * (180 ±0) + k * (112 ±0)` - // Estimated: `6287 + c * (901 ±29) + k * (901 ±29)` - // Minimum execution time: 11_229_000 picoseconds. - Weight::from_parts(11_336_000, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 175_749 - .saturating_add(Weight::from_parts(5_988_803, 0).saturating_mul(c.into())) - // Standard Error: 175_749 - .saturating_add(Weight::from_parts(5_610_271, 0).saturating_mul(k.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(k.into()))) - .saturating_add(Weight::from_parts(0, 901).saturating_mul(c.into())) - .saturating_add(Weight::from_parts(0, 901).saturating_mul(k.into())) - } - /// Storage: `CollatorSelection::CandidacyBond` (r:1 w:0) - /// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::CandidateList` (r:1 w:1) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// The range of component `c` is `[4, 100]`. - fn update_bond(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `287 + c * (50 ±0)` - // Estimated: `6287` - // Minimum execution time: 28_393_000 picoseconds. - Weight::from_parts(32_175_700, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 3_970 - .saturating_add(Weight::from_parts(141_768, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `CollatorSelection::CandidateList` (r:1 w:1) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::Invulnerables` (r:1 w:0) - /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// Storage: `Session::NextKeys` (r:1 w:0) - /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `CollatorSelection::CandidacyBond` (r:1 w:0) - /// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1) - /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - /// The range of component `c` is `[1, 99]`. - fn register_as_candidate(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `724 + c * (52 ±0)` - // Estimated: `6287 + c * (54 ±0)` - // Minimum execution time: 41_945_000 picoseconds. - Weight::from_parts(47_948_059, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 3_134 - .saturating_add(Weight::from_parts(167_461, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(Weight::from_parts(0, 54).saturating_mul(c.into())) - } - /// Storage: `CollatorSelection::Invulnerables` (r:1 w:0) - /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::CandidacyBond` (r:1 w:0) - /// Proof: `CollatorSelection::CandidacyBond` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) - /// Storage: `Session::NextKeys` (r:1 w:0) - /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `CollatorSelection::CandidateList` (r:1 w:1) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:2) - /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - /// The range of component `c` is `[4, 100]`. - fn take_candidate_slot(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `892 + c * (52 ±0)` - // Estimated: `6287 + c * (55 ±0)` - // Minimum execution time: 60_957_000 picoseconds. - Weight::from_parts(66_435_263, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 3_044 - .saturating_add(Weight::from_parts(170_126, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(4)) - .saturating_add(Weight::from_parts(0, 55).saturating_mul(c.into())) - } - /// Storage: `CollatorSelection::CandidateList` (r:1 w:1) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::Invulnerables` (r:1 w:0) - /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1) - /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - /// The range of component `c` is `[4, 100]`. - fn leave_intent(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `314 + c * (48 ±0)` - // Estimated: `6287` - // Minimum execution time: 31_777_000 picoseconds. - Weight::from_parts(36_837_543, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 4_164 - .saturating_add(Weight::from_parts(183_495, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::LastAuthoredBlock` (r:0 w:1) - /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - fn note_author() -> Weight { - // Proof Size summary in bytes: - // Measured: `103` - // Estimated: `6196` - // Minimum execution time: 42_719_000 picoseconds. - Weight::from_parts(43_694_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `CollatorSelection::CandidateList` (r:1 w:0) - /// Proof: `CollatorSelection::CandidateList` (`max_values`: Some(1), `max_size`: Some(4802), added: 5297, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::LastAuthoredBlock` (r:100 w:0) - /// Proof: `CollatorSelection::LastAuthoredBlock` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::Invulnerables` (r:1 w:0) - /// Proof: `CollatorSelection::Invulnerables` (`max_values`: Some(1), `max_size`: Some(641), added: 1136, mode: `MaxEncodedLen`) - /// Storage: `CollatorSelection::DesiredCandidates` (r:1 w:0) - /// Proof: `CollatorSelection::DesiredCandidates` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:97 w:97) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `r` is `[1, 100]`. - /// The range of component `c` is `[1, 100]`. - fn new_session(r: u32, c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `2180 + c * (97 ±0) + r * (112 ±0)` - // Estimated: `6287 + c * (2519 ±0) + r * (2603 ±0)` - // Minimum execution time: 19_779_000 picoseconds. - Weight::from_parts(20_188_000, 0) - .saturating_add(Weight::from_parts(0, 6287)) - // Standard Error: 310_110 - .saturating_add(Weight::from_parts(14_346_415, 0).saturating_mul(c.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into()))) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into()))) - .saturating_add(Weight::from_parts(0, 2519).saturating_mul(c.into())) - .saturating_add(Weight::from_parts(0, 2603).saturating_mul(r.into())) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_identity.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_identity.rs deleted file mode 100644 index a04444994ea13..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_identity.rs +++ /dev/null @@ -1,579 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_identity` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=pallet_identity -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_identity`. -pub struct WeightInfo(PhantomData); -impl pallet_identity::WeightInfo for WeightInfo { - /// Storage: `Identity::Registrars` (r:1 w:1) - /// Proof: `Identity::Registrars` (`max_values`: Some(1), `max_size`: Some(1141), added: 1636, mode: `MaxEncodedLen`) - /// The range of component `r` is `[1, 19]`. - fn add_registrar(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `32 + r * (57 ±0)` - // Estimated: `2626` - // Minimum execution time: 9_848_000 picoseconds. - Weight::from_parts(10_466_847, 0) - .saturating_add(Weight::from_parts(0, 2626)) - // Standard Error: 1_369 - .saturating_add(Weight::from_parts(106_104, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::IdentityOf` (r:1 w:1) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(804), added: 3279, mode: `MaxEncodedLen`) - /// The range of component `r` is `[1, 20]`. - fn set_identity(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `441 + r * (5 ±0)` - // Estimated: `4269` - // Minimum execution time: 19_928_000 picoseconds. - Weight::from_parts(20_737_832, 0) - .saturating_add(Weight::from_parts(0, 4269)) - // Standard Error: 1_535 - .saturating_add(Weight::from_parts(112_440, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::IdentityOf` (r:1 w:0) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(804), added: 3279, mode: `MaxEncodedLen`) - /// Storage: `Identity::SubsOf` (r:1 w:1) - /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(3258), added: 5733, mode: `MaxEncodedLen`) - /// Storage: `Identity::SuperOf` (r:100 w:100) - /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) - /// The range of component `s` is `[0, 100]`. - fn set_subs_new(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `101` - // Estimated: `6723 + s * (2589 ±0)` - // Minimum execution time: 13_948_000 picoseconds. - Weight::from_parts(27_705_253, 0) - .saturating_add(Weight::from_parts(0, 6723)) - // Standard Error: 6_263 - .saturating_add(Weight::from_parts(3_717_349, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(s.into()))) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) - .saturating_add(Weight::from_parts(0, 2589).saturating_mul(s.into())) - } - /// Storage: `Identity::IdentityOf` (r:1 w:0) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(804), added: 3279, mode: `MaxEncodedLen`) - /// Storage: `Identity::SubsOf` (r:1 w:1) - /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(3258), added: 5733, mode: `MaxEncodedLen`) - /// Storage: `Identity::SuperOf` (r:0 w:100) - /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) - /// The range of component `p` is `[0, 100]`. - fn set_subs_old(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `194 + p * (32 ±0)` - // Estimated: `6723` - // Minimum execution time: 13_719_000 picoseconds. - Weight::from_parts(27_841_625, 0) - .saturating_add(Weight::from_parts(0, 6723)) - // Standard Error: 4_083 - .saturating_add(Weight::from_parts(1_432_686, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(p.into()))) - } - /// Storage: `Identity::SubsOf` (r:1 w:1) - /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(3258), added: 5733, mode: `MaxEncodedLen`) - /// Storage: `Identity::IdentityOf` (r:1 w:1) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(804), added: 3279, mode: `MaxEncodedLen`) - /// Storage: `Identity::SuperOf` (r:0 w:100) - /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) - /// The range of component `r` is `[1, 20]`. - /// The range of component `s` is `[0, 100]`. - fn clear_identity(r: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `533 + r * (5 ±0) + s * (32 ±0)` - // Estimated: `6723` - // Minimum execution time: 31_443_000 picoseconds. - Weight::from_parts(31_973_880, 0) - .saturating_add(Weight::from_parts(0, 6723)) - // Standard Error: 26_019 - .saturating_add(Weight::from_parts(190_904, 0).saturating_mul(r.into())) - // Standard Error: 5_077 - .saturating_add(Weight::from_parts(1_416_448, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) - } - /// Storage: `Identity::Registrars` (r:1 w:0) - /// Proof: `Identity::Registrars` (`max_values`: Some(1), `max_size`: Some(1141), added: 1636, mode: `MaxEncodedLen`) - /// Storage: `Identity::IdentityOf` (r:1 w:1) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(804), added: 3279, mode: `MaxEncodedLen`) - /// The range of component `r` is `[1, 20]`. - fn request_judgement(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `431 + r * (57 ±0)` - // Estimated: `4269` - // Minimum execution time: 31_044_000 picoseconds. - Weight::from_parts(32_326_692, 0) - .saturating_add(Weight::from_parts(0, 4269)) - // Standard Error: 2_758 - .saturating_add(Weight::from_parts(143_778, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::IdentityOf` (r:1 w:1) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(804), added: 3279, mode: `MaxEncodedLen`) - /// The range of component `r` is `[1, 20]`. - fn cancel_request(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `462` - // Estimated: `4269` - // Minimum execution time: 29_052_000 picoseconds. - Weight::from_parts(29_936_298, 0) - .saturating_add(Weight::from_parts(0, 4269)) - // Standard Error: 2_163 - .saturating_add(Weight::from_parts(111_011, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::Registrars` (r:1 w:1) - /// Proof: `Identity::Registrars` (`max_values`: Some(1), `max_size`: Some(1141), added: 1636, mode: `MaxEncodedLen`) - /// The range of component `r` is `[1, 19]`. - fn set_fee(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `89 + r * (57 ±0)` - // Estimated: `2626` - // Minimum execution time: 6_877_000 picoseconds. - Weight::from_parts(7_427_649, 0) - .saturating_add(Weight::from_parts(0, 2626)) - // Standard Error: 1_398 - .saturating_add(Weight::from_parts(80_293, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::Registrars` (r:1 w:1) - /// Proof: `Identity::Registrars` (`max_values`: Some(1), `max_size`: Some(1141), added: 1636, mode: `MaxEncodedLen`) - /// The range of component `r` is `[1, 19]`. - fn set_account_id(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `89 + r * (57 ±0)` - // Estimated: `2626` - // Minimum execution time: 7_042_000 picoseconds. - Weight::from_parts(7_602_430, 0) - .saturating_add(Weight::from_parts(0, 2626)) - // Standard Error: 1_162 - .saturating_add(Weight::from_parts(71_047, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::Registrars` (r:1 w:1) - /// Proof: `Identity::Registrars` (`max_values`: Some(1), `max_size`: Some(1141), added: 1636, mode: `MaxEncodedLen`) - /// The range of component `r` is `[1, 19]`. - fn set_fields(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `89 + r * (57 ±0)` - // Estimated: `2626` - // Minimum execution time: 6_854_000 picoseconds. - Weight::from_parts(7_329_901, 0) - .saturating_add(Weight::from_parts(0, 2626)) - // Standard Error: 1_018 - .saturating_add(Weight::from_parts(75_560, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::Registrars` (r:1 w:0) - /// Proof: `Identity::Registrars` (`max_values`: Some(1), `max_size`: Some(1141), added: 1636, mode: `MaxEncodedLen`) - /// Storage: `Identity::IdentityOf` (r:1 w:1) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(804), added: 3279, mode: `MaxEncodedLen`) - /// The range of component `r` is `[1, 19]`. - fn provide_judgement(r: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `509 + r * (57 ±0)` - // Estimated: `4269` - // Minimum execution time: 21_996_000 picoseconds. - Weight::from_parts(22_871_139, 0) - .saturating_add(Weight::from_parts(0, 4269)) - // Standard Error: 1_805 - .saturating_add(Weight::from_parts(100_041, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::SubsOf` (r:1 w:1) - /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(3258), added: 5733, mode: `MaxEncodedLen`) - /// Storage: `Identity::IdentityOf` (r:1 w:1) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(804), added: 3279, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) - /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) - /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `Identity::SuperOf` (r:0 w:100) - /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) - /// The range of component `r` is `[1, 20]`. - /// The range of component `s` is `[0, 100]`. - fn kill_identity(r: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `742 + r * (5 ±0) + s * (32 ±0)` - // Estimated: `6723 + r * (6 ±0) + s * (32 ±0)` - // Minimum execution time: 84_637_000 picoseconds. - Weight::from_parts(88_522_543, 0) - .saturating_add(Weight::from_parts(0, 6723)) - // Standard Error: 19_867 - .saturating_add(Weight::from_parts(461_065, 0).saturating_mul(r.into())) - // Standard Error: 3_876 - .saturating_add(Weight::from_parts(1_506_725, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) - .saturating_add(Weight::from_parts(0, 6).saturating_mul(r.into())) - .saturating_add(Weight::from_parts(0, 32).saturating_mul(s.into())) - } - /// Storage: `Identity::IdentityOf` (r:1 w:0) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(804), added: 3279, mode: `MaxEncodedLen`) - /// Storage: `Identity::SuperOf` (r:1 w:1) - /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) - /// Storage: `Identity::SubsOf` (r:1 w:1) - /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(3258), added: 5733, mode: `MaxEncodedLen`) - /// The range of component `s` is `[0, 99]`. - fn add_sub(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `475 + s * (36 ±0)` - // Estimated: `6723` - // Minimum execution time: 29_500_000 picoseconds. - Weight::from_parts(35_101_317, 0) - .saturating_add(Weight::from_parts(0, 6723)) - // Standard Error: 1_634 - .saturating_add(Weight::from_parts(115_225, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Identity::IdentityOf` (r:1 w:0) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(804), added: 3279, mode: `MaxEncodedLen`) - /// Storage: `Identity::SuperOf` (r:1 w:1) - /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) - /// The range of component `s` is `[1, 100]`. - fn rename_sub(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `591 + s * (3 ±0)` - // Estimated: `4269` - // Minimum execution time: 18_210_000 picoseconds. - Weight::from_parts(20_927_042, 0) - .saturating_add(Weight::from_parts(0, 4269)) - // Standard Error: 768 - .saturating_add(Weight::from_parts(61_741, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::IdentityOf` (r:1 w:0) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(804), added: 3279, mode: `MaxEncodedLen`) - /// Storage: `Identity::SuperOf` (r:1 w:1) - /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) - /// Storage: `Identity::SubsOf` (r:1 w:1) - /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(3258), added: 5733, mode: `MaxEncodedLen`) - /// The range of component `s` is `[1, 100]`. - fn remove_sub(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `638 + s * (35 ±0)` - // Estimated: `6723` - // Minimum execution time: 33_777_000 picoseconds. - Weight::from_parts(41_132_711, 0) - .saturating_add(Weight::from_parts(0, 6723)) - // Standard Error: 1_840 - .saturating_add(Weight::from_parts(108_430, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Identity::SuperOf` (r:1 w:1) - /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) - /// Storage: `Identity::SubsOf` (r:1 w:1) - /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(3258), added: 5733, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:0) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `s` is `[0, 99]`. - fn quit_sub(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `667 + s * (37 ±0)` - // Estimated: `6723` - // Minimum execution time: 24_421_000 picoseconds. - Weight::from_parts(28_181_575, 0) - .saturating_add(Weight::from_parts(0, 6723)) - // Standard Error: 2_548 - .saturating_add(Weight::from_parts(148_324, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Identity::AuthorityOf` (r:0 w:1) - /// Proof: `Identity::AuthorityOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - fn add_username_authority() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 7_053_000 picoseconds. - Weight::from_parts(7_337_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::AuthorityOf` (r:1 w:1) - /// Proof: `Identity::AuthorityOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - fn remove_username_authority() -> Weight { - // Proof Size summary in bytes: - // Measured: `79` - // Estimated: `3517` - // Minimum execution time: 10_714_000 picoseconds. - Weight::from_parts(11_383_000, 0) - .saturating_add(Weight::from_parts(0, 3517)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::AuthorityOf` (r:1 w:1) - /// Proof: `Identity::AuthorityOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `Identity::UsernameInfoOf` (r:1 w:1) - /// Proof: `Identity::UsernameInfoOf` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) - /// Storage: `Identity::PendingUsernames` (r:1 w:0) - /// Proof: `Identity::PendingUsernames` (`max_values`: None, `max_size`: Some(102), added: 2577, mode: `MaxEncodedLen`) - /// Storage: `Identity::UsernameOf` (r:1 w:1) - /// Proof: `Identity::UsernameOf` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `p` is `[0, 1]`. - fn set_username_for(_p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `182` - // Estimated: `3593` - // Minimum execution time: 68_588_000 picoseconds. - Weight::from_parts(88_797_132, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: `Identity::PendingUsernames` (r:1 w:1) - /// Proof: `Identity::PendingUsernames` (`max_values`: None, `max_size`: Some(102), added: 2577, mode: `MaxEncodedLen`) - /// Storage: `Identity::UsernameOf` (r:1 w:1) - /// Proof: `Identity::UsernameOf` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) - /// Storage: `Identity::UsernameInfoOf` (r:0 w:1) - /// Proof: `Identity::UsernameInfoOf` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) - fn accept_username() -> Weight { - // Proof Size summary in bytes: - // Measured: `116` - // Estimated: `3567` - // Minimum execution time: 21_542_000 picoseconds. - Weight::from_parts(22_436_000, 0) - .saturating_add(Weight::from_parts(0, 3567)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Identity::PendingUsernames` (r:1 w:1) - /// Proof: `Identity::PendingUsernames` (`max_values`: None, `max_size`: Some(102), added: 2577, mode: `MaxEncodedLen`) - /// Storage: `Identity::AuthorityOf` (r:1 w:0) - /// Proof: `Identity::AuthorityOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `p` is `[0, 1]`. - fn remove_expired_approval(_p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `310` - // Estimated: `3593` - // Minimum execution time: 15_593_000 picoseconds. - Weight::from_parts(38_944_828, 0) - .saturating_add(Weight::from_parts(0, 3593)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Identity::UsernameInfoOf` (r:1 w:0) - /// Proof: `Identity::UsernameInfoOf` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) - /// Storage: `Identity::UsernameOf` (r:0 w:1) - /// Proof: `Identity::UsernameOf` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) - fn set_primary_username() -> Weight { - // Proof Size summary in bytes: - // Measured: `172` - // Estimated: `3563` - // Minimum execution time: 13_891_000 picoseconds. - Weight::from_parts(14_833_000, 0) - .saturating_add(Weight::from_parts(0, 3563)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::UsernameInfoOf` (r:1 w:0) - /// Proof: `Identity::UsernameInfoOf` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) - /// Storage: `Identity::AuthorityOf` (r:1 w:0) - /// Proof: `Identity::AuthorityOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `Identity::UnbindingUsernames` (r:1 w:1) - /// Proof: `Identity::UnbindingUsernames` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) - fn unbind_username() -> Weight { - // Proof Size summary in bytes: - // Measured: `236` - // Estimated: `3563` - // Minimum execution time: 18_974_000 picoseconds. - Weight::from_parts(19_243_000, 0) - .saturating_add(Weight::from_parts(0, 3563)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::UnbindingUsernames` (r:1 w:1) - /// Proof: `Identity::UnbindingUsernames` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) - /// Storage: `Identity::UsernameInfoOf` (r:1 w:1) - /// Proof: `Identity::UsernameInfoOf` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) - /// Storage: `Identity::UsernameOf` (r:1 w:1) - /// Proof: `Identity::UsernameOf` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) - /// Storage: `Identity::AuthorityOf` (r:1 w:0) - /// Proof: `Identity::AuthorityOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - fn remove_username() -> Weight { - // Proof Size summary in bytes: - // Measured: `297` - // Estimated: `3563` - // Minimum execution time: 23_448_000 picoseconds. - Weight::from_parts(24_410_000, 0) - .saturating_add(Weight::from_parts(0, 3563)) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Identity::UsernameInfoOf` (r:1 w:1) - /// Proof: `Identity::UsernameInfoOf` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) - /// Storage: `Identity::UsernameOf` (r:1 w:1) - /// Proof: `Identity::UsernameOf` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) - /// Storage: `Identity::UnbindingUsernames` (r:1 w:1) - /// Proof: `Identity::UnbindingUsernames` (`max_values`: None, `max_size`: Some(53), added: 2528, mode: `MaxEncodedLen`) - /// Storage: `Identity::AuthorityOf` (r:1 w:0) - /// Proof: `Identity::AuthorityOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:2 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) - /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) - /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// The range of component `p` is `[0, 1]`. - fn kill_username(_p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `540` - // Estimated: `6196` - // Minimum execution time: 21_407_000 picoseconds. - Weight::from_parts(82_016_546, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: UNKNOWN KEY `0x2aeddc77fe58c98d50bd37f1b90840f99622d1423cdd16f5c33e2b531c34a53d` (r:2 w:0) - /// Proof: UNKNOWN KEY `0x2aeddc77fe58c98d50bd37f1b90840f99622d1423cdd16f5c33e2b531c34a53d` (r:2 w:0) - /// Storage: `Identity::AuthorityOf` (r:0 w:1) - /// Proof: `Identity::AuthorityOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - fn migration_v2_authority_step() -> Weight { - // Proof Size summary in bytes: - // Measured: `147` - // Estimated: `6087` - // Minimum execution time: 8_850_000 picoseconds. - Weight::from_parts(9_249_000, 0) - .saturating_add(Weight::from_parts(0, 6087)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: UNKNOWN KEY `0x2aeddc77fe58c98d50bd37f1b90840f97c182fead9255863460affdd63116be3` (r:2 w:0) - /// Proof: UNKNOWN KEY `0x2aeddc77fe58c98d50bd37f1b90840f97c182fead9255863460affdd63116be3` (r:2 w:0) - /// Storage: `Identity::UsernameInfoOf` (r:0 w:1) - /// Proof: `Identity::UsernameInfoOf` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) - fn migration_v2_username_step() -> Weight { - // Proof Size summary in bytes: - // Measured: `159` - // Estimated: `6099` - // Minimum execution time: 8_810_000 picoseconds. - Weight::from_parts(9_163_000, 0) - .saturating_add(Weight::from_parts(0, 6099)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::IdentityOf` (r:2 w:1) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(804), added: 3279, mode: `MaxEncodedLen`) - /// Storage: `Identity::UsernameOf` (r:0 w:1) - /// Proof: `Identity::UsernameOf` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`) - fn migration_v2_identity_step() -> Weight { - // Proof Size summary in bytes: - // Measured: `526` - // Estimated: `7548` - // Minimum execution time: 13_549_000 picoseconds. - Weight::from_parts(14_194_000, 0) - .saturating_add(Weight::from_parts(0, 7548)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Identity::PendingUsernames` (r:2 w:1) - /// Proof: `Identity::PendingUsernames` (`max_values`: None, `max_size`: Some(102), added: 2577, mode: `MaxEncodedLen`) - fn migration_v2_pending_username_step() -> Weight { - // Proof Size summary in bytes: - // Measured: `201` - // Estimated: `6144` - // Minimum execution time: 8_112_000 picoseconds. - Weight::from_parts(8_441_000, 0) - .saturating_add(Weight::from_parts(0, 6144)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::AuthorityOf` (r:2 w:0) - /// Proof: `Identity::AuthorityOf` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: UNKNOWN KEY `0x2aeddc77fe58c98d50bd37f1b90840f99622d1423cdd16f5c33e2b531c34a53d` (r:1 w:1) - /// Proof: UNKNOWN KEY `0x2aeddc77fe58c98d50bd37f1b90840f99622d1423cdd16f5c33e2b531c34a53d` (r:1 w:1) - fn migration_v2_cleanup_authority_step() -> Weight { - // Proof Size summary in bytes: - // Measured: `288` - // Estimated: `6044` - // Minimum execution time: 11_749_000 picoseconds. - Weight::from_parts(12_322_000, 0) - .saturating_add(Weight::from_parts(0, 6044)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Identity::UsernameInfoOf` (r:2 w:0) - /// Proof: `Identity::UsernameInfoOf` (`max_values`: None, `max_size`: Some(98), added: 2573, mode: `MaxEncodedLen`) - /// Storage: UNKNOWN KEY `0x2aeddc77fe58c98d50bd37f1b90840f97c182fead9255863460affdd63116be3` (r:1 w:1) - /// Proof: UNKNOWN KEY `0x2aeddc77fe58c98d50bd37f1b90840f97c182fead9255863460affdd63116be3` (r:1 w:1) - fn migration_v2_cleanup_username_step() -> Weight { - // Proof Size summary in bytes: - // Measured: `290` - // Estimated: `6136` - // Minimum execution time: 10_486_000 picoseconds. - Weight::from_parts(11_408_000, 0) - .saturating_add(Weight::from_parts(0, 6136)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(1)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_message_queue.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_message_queue.rs deleted file mode 100644 index b828850163e07..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_message_queue.rs +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_message_queue` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=pallet_message_queue -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_message_queue`. -pub struct WeightInfo(PhantomData); -impl pallet_message_queue::WeightInfo for WeightInfo { - /// Storage: `MessageQueue::ServiceHead` (r:1 w:0) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::BookStateFor` (r:2 w:2) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - fn ready_ring_knit() -> Weight { - // Proof Size summary in bytes: - // Measured: `223` - // Estimated: `6044` - // Minimum execution time: 13_244_000 picoseconds. - Weight::from_parts(14_004_000, 0) - .saturating_add(Weight::from_parts(0, 6044)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `MessageQueue::BookStateFor` (r:2 w:2) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - fn ready_ring_unknit() -> Weight { - // Proof Size summary in bytes: - // Measured: `218` - // Estimated: `6044` - // Minimum execution time: 12_387_000 picoseconds. - Weight::from_parts(12_858_000, 0) - .saturating_add(Weight::from_parts(0, 6044)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - fn service_queue_base() -> Weight { - // Proof Size summary in bytes: - // Measured: `6` - // Estimated: `3517` - // Minimum execution time: 4_116_000 picoseconds. - Weight::from_parts(4_387_000, 0) - .saturating_add(Weight::from_parts(0, 3517)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `MessageQueue::Pages` (r:1 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn service_page_base_completion() -> Weight { - // Proof Size summary in bytes: - // Measured: `72` - // Estimated: `108986` - // Minimum execution time: 6_433_000 picoseconds. - Weight::from_parts(6_823_000, 0) - .saturating_add(Weight::from_parts(0, 108986)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `MessageQueue::Pages` (r:1 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn service_page_base_no_completion() -> Weight { - // Proof Size summary in bytes: - // Measured: `72` - // Estimated: `108986` - // Minimum execution time: 6_457_000 picoseconds. - Weight::from_parts(7_044_000, 0) - .saturating_add(Weight::from_parts(0, 108986)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `MessageQueue::BookStateFor` (r:0 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:0 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn service_page_item() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 289_599_000 picoseconds. - Weight::from_parts(298_013_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `MessageQueue::ServiceHead` (r:1 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::BookStateFor` (r:1 w:0) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - fn bump_service_head() -> Weight { - // Proof Size summary in bytes: - // Measured: `171` - // Estimated: `3517` - // Minimum execution time: 7_791_000 picoseconds. - Weight::from_parts(8_120_000, 0) - .saturating_add(Weight::from_parts(0, 3517)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `MessageQueue::BookStateFor` (r:1 w:0) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::ServiceHead` (r:0 w:1) - /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`) - fn set_service_head() -> Weight { - // Proof Size summary in bytes: - // Measured: `161` - // Estimated: `3517` - // Minimum execution time: 6_337_000 picoseconds. - Weight::from_parts(6_671_000, 0) - .saturating_add(Weight::from_parts(0, 3517)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:1 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn reap_page() -> Weight { - // Proof Size summary in bytes: - // Measured: `105609` - // Estimated: `108986` - // Minimum execution time: 112_313_000 picoseconds. - Weight::from_parts(113_580_000, 0) - .saturating_add(Weight::from_parts(0, 108986)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:1 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn execute_overweight_page_removed() -> Weight { - // Proof Size summary in bytes: - // Measured: `105609` - // Estimated: `108986` - // Minimum execution time: 142_383_000 picoseconds. - Weight::from_parts(144_443_000, 0) - .saturating_add(Weight::from_parts(0, 108986)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `MessageQueue::BookStateFor` (r:1 w:1) - /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MessageQueue::Pages` (r:1 w:1) - /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`) - fn execute_overweight_page_updated() -> Weight { - // Proof Size summary in bytes: - // Measured: `105609` - // Estimated: `108986` - // Minimum execution time: 204_483_000 picoseconds. - Weight::from_parts(210_871_000, 0) - .saturating_add(Weight::from_parts(0, 108986)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_migrations.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_migrations.rs deleted file mode 100644 index 15c453d9192bc..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_migrations.rs +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_migrations` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=pallet_migrations -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_migrations`. -pub struct WeightInfo(PhantomData); -impl pallet_migrations::WeightInfo for WeightInfo { - /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:1) - /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) - /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) - fn onboard_new_mbms() -> Weight { - // Proof Size summary in bytes: - // Measured: `71` - // Estimated: `67035` - // Minimum execution time: 8_430_000 picoseconds. - Weight::from_parts(8_626_000, 0) - .saturating_add(Weight::from_parts(0, 67035)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) - /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) - fn progress_mbms_none() -> Weight { - // Proof Size summary in bytes: - // Measured: `42` - // Estimated: `67035` - // Minimum execution time: 2_717_000 picoseconds. - Weight::from_parts(2_849_000, 0) - .saturating_add(Weight::from_parts(0, 67035)) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) - /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) - /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) - fn exec_migration_completed() -> Weight { - // Proof Size summary in bytes: - // Measured: `29` - // Estimated: `3494` - // Minimum execution time: 5_991_000 picoseconds. - Weight::from_parts(6_200_000, 0) - .saturating_add(Weight::from_parts(0, 3494)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) - /// Storage: `MultiBlockMigrations::Historic` (r:1 w:0) - /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) - fn exec_migration_skipped_historic() -> Weight { - // Proof Size summary in bytes: - // Measured: `125` - // Estimated: `3731` - // Minimum execution time: 11_447_000 picoseconds. - Weight::from_parts(11_825_000, 0) - .saturating_add(Weight::from_parts(0, 3731)) - .saturating_add(T::DbWeight::get().reads(2)) - } - /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) - /// Storage: `MultiBlockMigrations::Historic` (r:1 w:0) - /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) - fn exec_migration_advance() -> Weight { - // Proof Size summary in bytes: - // Measured: `71` - // Estimated: `3731` - // Minimum execution time: 11_096_000 picoseconds. - Weight::from_parts(11_324_000, 0) - .saturating_add(Weight::from_parts(0, 3731)) - .saturating_add(T::DbWeight::get().reads(2)) - } - /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) - /// Storage: `MultiBlockMigrations::Historic` (r:1 w:1) - /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) - fn exec_migration_complete() -> Weight { - // Proof Size summary in bytes: - // Measured: `71` - // Estimated: `3731` - // Minimum execution time: 12_627_000 picoseconds. - Weight::from_parts(13_076_000, 0) - .saturating_add(Weight::from_parts(0, 3731)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) - /// Storage: `MultiBlockMigrations::Historic` (r:1 w:0) - /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) - /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) - /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) - fn exec_migration_fail() -> Weight { - // Proof Size summary in bytes: - // Measured: `71` - // Estimated: `3731` - // Minimum execution time: 13_532_000 picoseconds. - Weight::from_parts(13_887_000, 0) - .saturating_add(Weight::from_parts(0, 3731)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - fn on_init_loop() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 195_000 picoseconds. - Weight::from_parts(220_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) - /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) - fn force_set_cursor() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_677_000 picoseconds. - Weight::from_parts(2_965_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `MultiBlockMigrations::Cursor` (r:0 w:1) - /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) - fn force_set_active_cursor() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_143_000 picoseconds. - Weight::from_parts(3_356_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `MultiBlockMigrations::Cursor` (r:1 w:0) - /// Proof: `MultiBlockMigrations::Cursor` (`max_values`: Some(1), `max_size`: Some(65550), added: 66045, mode: `MaxEncodedLen`) - /// Storage: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) - /// Proof: UNKNOWN KEY `0x583359fe0e84d953a9dd84e8addb08a5` (r:1 w:0) - fn force_onboard_mbms() -> Weight { - // Proof Size summary in bytes: - // Measured: `85` - // Estimated: `67035` - // Minimum execution time: 6_844_000 picoseconds. - Weight::from_parts(7_095_000, 0) - .saturating_add(Weight::from_parts(0, 67035)) - .saturating_add(T::DbWeight::get().reads(2)) - } - /// Storage: `MultiBlockMigrations::Historic` (r:256 w:256) - /// Proof: `MultiBlockMigrations::Historic` (`max_values`: None, `max_size`: Some(266), added: 2741, mode: `MaxEncodedLen`) - /// The range of component `n` is `[0, 256]`. - fn clear_historic(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1022 + n * (271 ±0)` - // Estimated: `3834 + n * (2740 ±0)` - // Minimum execution time: 16_491_000 picoseconds. - Weight::from_parts(15_159_833, 0) - .saturating_add(Weight::from_parts(0, 3834)) - // Standard Error: 3_053 - .saturating_add(Weight::from_parts(1_456_192, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 2740).saturating_mul(n.into())) - } - /// Storage: `Skipped::Metadata` (r:0 w:0) - /// Proof: `Skipped::Metadata` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// The range of component `n` is `[0, 2048]`. - fn reset_pallet_migration(n: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `1642 + n * (38 ±0)` - // Estimated: `720 + n * (39 ±0)` - // Minimum execution time: 1_861_000 picoseconds. - Weight::from_parts(8_542_096, 0) - .saturating_add(Weight::from_parts(0, 720)) - // Standard Error: 1_577 - .saturating_add(Weight::from_parts(844_168, 0).saturating_mul(n.into())) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into()))) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into()))) - .saturating_add(Weight::from_parts(0, 39).saturating_mul(n.into())) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_multisig.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_multisig.rs deleted file mode 100644 index c60c8a657bc55..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_multisig.rs +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_multisig` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-25, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `c8c7296f7413`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=pallet_multisig -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_multisig`. -pub struct WeightInfo(PhantomData); -impl pallet_multisig::WeightInfo for WeightInfo { - /// The range of component `z` is `[0, 10000]`. - fn as_multi_threshold_1(z: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 15_740_000 picoseconds. - Weight::from_parts(16_129_400, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 18 - .saturating_add(Weight::from_parts(949, 0).saturating_mul(z.into())) - } - /// Storage: `Multisig::Multisigs` (r:1 w:1) - /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) - /// The range of component `s` is `[2, 100]`. - /// The range of component `z` is `[0, 10000]`. - fn as_multi_create(s: u32, z: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `262 + s * (2 ±0)` - // Estimated: `6811` - // Minimum execution time: 47_726_000 picoseconds. - Weight::from_parts(42_770_458, 0) - .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 5_216 - .saturating_add(Weight::from_parts(92_088, 0).saturating_mul(s.into())) - // Standard Error: 51 - .saturating_add(Weight::from_parts(1_836, 0).saturating_mul(z.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Multisig::Multisigs` (r:1 w:1) - /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) - /// The range of component `s` is `[3, 100]`. - /// The range of component `z` is `[0, 10000]`. - fn as_multi_approve(s: u32, z: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `282` - // Estimated: `6811` - // Minimum execution time: 30_839_000 picoseconds. - Weight::from_parts(17_024_830, 0) - .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 1_897 - .saturating_add(Weight::from_parts(152_893, 0).saturating_mul(s.into())) - // Standard Error: 18 - .saturating_add(Weight::from_parts(2_077, 0).saturating_mul(z.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Multisig::Multisigs` (r:1 w:1) - /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `s` is `[2, 100]`. - /// The range of component `z` is `[0, 10000]`. - fn as_multi_complete(s: u32, z: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `385 + s * (33 ±0)` - // Estimated: `6811` - // Minimum execution time: 51_336_000 picoseconds. - Weight::from_parts(33_150_111, 0) - .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 2_792 - .saturating_add(Weight::from_parts(210_323, 0).saturating_mul(s.into())) - // Standard Error: 27 - .saturating_add(Weight::from_parts(2_275, 0).saturating_mul(z.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Multisig::Multisigs` (r:1 w:1) - /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) - /// The range of component `s` is `[2, 100]`. - fn approve_as_multi_create(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `263 + s * (2 ±0)` - // Estimated: `6811` - // Minimum execution time: 29_377_000 picoseconds. - Weight::from_parts(31_278_890, 0) - .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 1_426 - .saturating_add(Weight::from_parts(167_735, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Multisig::Multisigs` (r:1 w:1) - /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) - /// The range of component `s` is `[2, 100]`. - fn approve_as_multi_approve(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `282` - // Estimated: `6811` - // Minimum execution time: 16_734_000 picoseconds. - Weight::from_parts(18_265_217, 0) - .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 1_209 - .saturating_add(Weight::from_parts(133_740, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Multisig::Multisigs` (r:1 w:1) - /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) - /// The range of component `s` is `[2, 100]`. - fn cancel_as_multi(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `454 + s * (1 ±0)` - // Estimated: `6811` - // Minimum execution time: 30_167_000 picoseconds. - Weight::from_parts(32_070_456, 0) - .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 1_666 - .saturating_add(Weight::from_parts(163_065, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Multisig::Multisigs` (r:1 w:1) - /// Proof: `Multisig::Multisigs` (`max_values`: None, `max_size`: Some(3346), added: 5821, mode: `MaxEncodedLen`) - /// The range of component `s` is `[2, 100]`. - fn poke_deposit(s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `454 + s * (1 ±0)` - // Estimated: `6811` - // Minimum execution time: 29_156_000 picoseconds. - Weight::from_parts(30_828_857, 0) - .saturating_add(Weight::from_parts(0, 6811)) - // Standard Error: 1_194 - .saturating_add(Weight::from_parts(145_508, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_proxy.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_proxy.rs deleted file mode 100644 index c971e1a96379b..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_proxy.rs +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_proxy` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-03-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `99fc4dfa9c86`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=pallet_proxy -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_proxy`. -pub struct WeightInfo(PhantomData); -impl pallet_proxy::WeightInfo for WeightInfo { - /// Storage: `Proxy::Proxies` (r:1 w:0) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// The range of component `p` is `[1, 31]`. - fn proxy(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `127 + p * (37 ±0)` - // Estimated: `4706` - // Minimum execution time: 14_193_000 picoseconds. - Weight::from_parts(14_814_540, 0) - .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_163 - .saturating_add(Weight::from_parts(25_891, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: `Proxy::Proxies` (r:1 w:0) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// Storage: `Proxy::Announcements` (r:1 w:1) - /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `a` is `[0, 31]`. - /// The range of component `p` is `[1, 31]`. - fn proxy_announced(a: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `454 + a * (68 ±0) + p * (37 ±0)` - // Estimated: `5698` - // Minimum execution time: 40_717_000 picoseconds. - Weight::from_parts(41_406_158, 0) - .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 3_363 - .saturating_add(Weight::from_parts(149_287, 0).saturating_mul(a.into())) - // Standard Error: 3_475 - .saturating_add(Weight::from_parts(53_202, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Proxy::Announcements` (r:1 w:1) - /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `a` is `[0, 31]`. - /// The range of component `p` is `[1, 31]`. - fn remove_announcement(a: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `369 + a * (68 ±0)` - // Estimated: `5698` - // Minimum execution time: 25_574_000 picoseconds. - Weight::from_parts(25_943_471, 0) - .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 1_934 - .saturating_add(Weight::from_parts(145_112, 0).saturating_mul(a.into())) - // Standard Error: 1_998 - .saturating_add(Weight::from_parts(31_322, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Proxy::Announcements` (r:1 w:1) - /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `a` is `[0, 31]`. - /// The range of component `p` is `[1, 31]`. - fn reject_announcement(a: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `369 + a * (68 ±0)` - // Estimated: `5698` - // Minimum execution time: 25_649_000 picoseconds. - Weight::from_parts(25_882_341, 0) - .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 2_025 - .saturating_add(Weight::from_parts(142_994, 0).saturating_mul(a.into())) - // Standard Error: 2_092 - .saturating_add(Weight::from_parts(34_199, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Proxy::Proxies` (r:1 w:0) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// Storage: `Proxy::Announcements` (r:1 w:1) - /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// The range of component `a` is `[0, 31]`. - /// The range of component `p` is `[1, 31]`. - fn announce(a: u32, p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `386 + a * (68 ±0) + p * (37 ±0)` - // Estimated: `5698` - // Minimum execution time: 37_082_000 picoseconds. - Weight::from_parts(37_886_513, 0) - .saturating_add(Weight::from_parts(0, 5698)) - // Standard Error: 3_640 - .saturating_add(Weight::from_parts(144_359, 0).saturating_mul(a.into())) - // Standard Error: 3_760 - .saturating_add(Weight::from_parts(45_703, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Proxy::Proxies` (r:1 w:1) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// The range of component `p` is `[1, 31]`. - fn add_proxy(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `127 + p * (37 ±0)` - // Estimated: `4706` - // Minimum execution time: 23_957_000 picoseconds. - Weight::from_parts(24_927_975, 0) - .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_758 - .saturating_add(Weight::from_parts(43_725, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Proxy::Proxies` (r:1 w:1) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// The range of component `p` is `[1, 31]`. - fn remove_proxy(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `127 + p * (37 ±0)` - // Estimated: `4706` - // Minimum execution time: 23_729_000 picoseconds. - Weight::from_parts(24_583_323, 0) - .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_400 - .saturating_add(Weight::from_parts(45_509, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Proxy::Proxies` (r:1 w:1) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// The range of component `p` is `[1, 31]`. - fn remove_proxies(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `127 + p * (37 ±0)` - // Estimated: `4706` - // Minimum execution time: 21_192_000 picoseconds. - Weight::from_parts(21_995_477, 0) - .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_926 - .saturating_add(Weight::from_parts(34_525, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Proxy::Proxies` (r:1 w:1) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// The range of component `p` is `[1, 31]`. - fn create_pure(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `139` - // Estimated: `4706` - // Minimum execution time: 25_253_000 picoseconds. - Weight::from_parts(26_188_295, 0) - .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_659 - .saturating_add(Weight::from_parts(22_321, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Proxy::Proxies` (r:1 w:1) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// The range of component `p` is `[0, 30]`. - fn kill_pure(p: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `164 + p * (37 ±0)` - // Estimated: `4706` - // Minimum execution time: 22_278_000 picoseconds. - Weight::from_parts(23_226_079, 0) - .saturating_add(Weight::from_parts(0, 4706)) - // Standard Error: 1_375 - .saturating_add(Weight::from_parts(23_729, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Proxy::Proxies` (r:1 w:1) - /// Proof: `Proxy::Proxies` (`max_values`: None, `max_size`: Some(1241), added: 3716, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Proxy::Announcements` (r:1 w:1) - /// Proof: `Proxy::Announcements` (`max_values`: None, `max_size`: Some(2233), added: 4708, mode: `MaxEncodedLen`) - fn poke_deposit() -> Weight { - // Proof Size summary in bytes: - // Measured: `453` - // Estimated: `5698` - // Minimum execution time: 43_833_000 picoseconds. - Weight::from_parts(44_489_000, 0) - .saturating_add(Weight::from_parts(0, 5698)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_session.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_session.rs deleted file mode 100644 index 1f93aa756a8ee..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_session.rs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_session` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=pallet_session -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_session`. -pub struct WeightInfo(PhantomData); -impl pallet_session::WeightInfo for WeightInfo { - /// Storage: `Session::NextKeys` (r:1 w:1) - /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Session::KeyOwner` (r:1 w:1) - /// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn set_keys() -> Weight { - // Proof Size summary in bytes: - // Measured: `271` - // Estimated: `3736` - // Minimum execution time: 18_404_000 picoseconds. - Weight::from_parts(18_873_000, 0) - .saturating_add(Weight::from_parts(0, 3736)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `Session::NextKeys` (r:1 w:1) - /// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `Session::KeyOwner` (r:0 w:1) - /// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn purge_keys() -> Weight { - // Proof Size summary in bytes: - // Measured: `243` - // Estimated: `3708` - // Minimum execution time: 13_408_000 picoseconds. - Weight::from_parts(13_766_000, 0) - .saturating_add(Weight::from_parts(0, 3708)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_timestamp.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_timestamp.rs deleted file mode 100644 index 7cff044ec2b71..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_timestamp.rs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_timestamp` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=pallet_timestamp -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_timestamp`. -pub struct WeightInfo(PhantomData); -impl pallet_timestamp::WeightInfo for WeightInfo { - /// Storage: `Timestamp::Now` (r:1 w:1) - /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) - /// Storage: `Aura::CurrentSlot` (r:1 w:0) - /// Proof: `Aura::CurrentSlot` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) - fn set() -> Weight { - // Proof Size summary in bytes: - // Measured: `85` - // Estimated: `1493` - // Minimum execution time: 8_096_000 picoseconds. - Weight::from_parts(8_404_000, 0) - .saturating_add(Weight::from_parts(0, 1493)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - fn on_finalize() -> Weight { - // Proof Size summary in bytes: - // Measured: `94` - // Estimated: `0` - // Minimum execution time: 4_510_000 picoseconds. - Weight::from_parts(4_707_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_transaction_payment.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_transaction_payment.rs deleted file mode 100644 index e8a4d1e583583..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_transaction_payment.rs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_transaction_payment` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=pallet_transaction_payment -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_transaction_payment`. -pub struct WeightInfo(PhantomData); -impl pallet_transaction_payment::WeightInfo for WeightInfo { - /// Storage: `System::Account` (r:2 w:2) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn charge_transaction_payment() -> Weight { - // Proof Size summary in bytes: - // Measured: `101` - // Estimated: `6196` - // Minimum execution time: 44_019_000 picoseconds. - Weight::from_parts(45_193_000, 0) - .saturating_add(Weight::from_parts(0, 6196)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_utility.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_utility.rs deleted file mode 100644 index 4795df9a313bb..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_utility.rs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_utility` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=pallet_utility -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_utility`. -pub struct WeightInfo(PhantomData); -impl pallet_utility::WeightInfo for WeightInfo { - /// The range of component `c` is `[0, 1000]`. - fn batch(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_054_000 picoseconds. - Weight::from_parts(5_176_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 715 - .saturating_add(Weight::from_parts(3_005_267, 0).saturating_mul(c.into())) - } - fn as_derivative() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 4_581_000 picoseconds. - Weight::from_parts(4_788_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// The range of component `c` is `[0, 1000]`. - fn batch_all(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_037_000 picoseconds. - Weight::from_parts(5_257_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 791 - .saturating_add(Weight::from_parts(3_206_939, 0).saturating_mul(c.into())) - } - fn dispatch_as() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_872_000 picoseconds. - Weight::from_parts(7_124_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// The range of component `c` is `[0, 1000]`. - fn force_batch(c: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 5_060_000 picoseconds. - Weight::from_parts(5_180_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - // Standard Error: 660 - .saturating_add(Weight::from_parts(2_996_117, 0).saturating_mul(c.into())) - } - fn dispatch_as_fallible() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 6_863_000 picoseconds. - Weight::from_parts(7_157_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn if_else() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 8_589_000 picoseconds. - Weight::from_parts(8_868_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_xcm.rs deleted file mode 100644 index 81b759de27100..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_xcm.rs +++ /dev/null @@ -1,390 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_xcm` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=pallet_xcm -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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_xcm`. -pub struct WeightInfo(PhantomData); -impl pallet_xcm::WeightInfo for WeightInfo { - /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) - /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - fn send() -> Weight { - // Proof Size summary in bytes: - // Measured: `244` - // Estimated: `3709` - // Minimum execution time: 34_158_000 picoseconds. - Weight::from_parts(35_174_000, 0) - .saturating_add(Weight::from_parts(0, 3709)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) - /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) - /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - fn teleport_assets() -> Weight { - // Proof Size summary in bytes: - // Measured: `244` - // Estimated: `3709` - // Minimum execution time: 116_998_000 picoseconds. - Weight::from_parts(120_674_000, 0) - .saturating_add(Weight::from_parts(0, 3709)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `Benchmark::Override` (r:0 w:0) - /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn reserve_transfer_assets() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. - Weight::from_parts(18_446_744_073_709_551_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) - /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) - /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - fn transfer_assets() -> Weight { - // Proof Size summary in bytes: - // Measured: `244` - // Estimated: `3709` - // Minimum execution time: 116_783_000 picoseconds. - Weight::from_parts(121_527_000, 0) - .saturating_add(Weight::from_parts(0, 3709)) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) - /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn execute() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `1485` - // Minimum execution time: 9_424_000 picoseconds. - Weight::from_parts(9_737_000, 0) - .saturating_add(Weight::from_parts(0, 1485)) - .saturating_add(T::DbWeight::get().reads(1)) - } - /// Storage: `PolkadotXcm::SupportedVersion` (r:0 w:1) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn force_xcm_version() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 7_875_000 picoseconds. - Weight::from_parts(8_130_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - fn force_default_xcm_version() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_381_000 picoseconds. - Weight::from_parts(2_561_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) - /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) - /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::Queries` (r:0 w:1) - /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn force_subscribe_version_notify() -> Weight { - // Proof Size summary in bytes: - // Measured: `175` - // Estimated: `3640` - // Minimum execution time: 36_927_000 picoseconds. - Weight::from_parts(38_308_000, 0) - .saturating_add(Weight::from_parts(0, 3640)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(5)) - } - /// Storage: `PolkadotXcm::VersionNotifiers` (r:1 w:1) - /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:0) - /// Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - /// Storage: `XcmpQueue::OutboundXcmpMessages` (r:1 w:1) - /// Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::Queries` (r:0 w:1) - /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn force_unsubscribe_version_notify() -> Weight { - // Proof Size summary in bytes: - // Measured: `334` - // Estimated: `108971` - // Minimum execution time: 42_365_000 picoseconds. - Weight::from_parts(43_757_000, 0) - .saturating_add(Weight::from_parts(0, 108971)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: `PolkadotXcm::XcmExecutionSuspended` (r:0 w:1) - /// Proof: `PolkadotXcm::XcmExecutionSuspended` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn force_suspension() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_365_000 picoseconds. - Weight::from_parts(2_499_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `PolkadotXcm::SupportedVersion` (r:6 w:2) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn migrate_supported_version() -> Weight { - // Proof Size summary in bytes: - // Measured: `23` - // Estimated: `15863` - // Minimum execution time: 20_424_000 picoseconds. - Weight::from_parts(21_184_000, 0) - .saturating_add(Weight::from_parts(0, 15863)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `PolkadotXcm::VersionNotifiers` (r:6 w:2) - /// Proof: `PolkadotXcm::VersionNotifiers` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn migrate_version_notifiers() -> Weight { - // Proof Size summary in bytes: - // Measured: `27` - // Estimated: `15867` - // Minimum execution time: 20_641_000 picoseconds. - Weight::from_parts(21_383_000, 0) - .saturating_add(Weight::from_parts(0, 15867)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:7 w:0) - /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn already_notified_target() -> Weight { - // Proof Size summary in bytes: - // Measured: `79` - // Estimated: `18394` - // Minimum execution time: 25_931_000 picoseconds. - Weight::from_parts(26_547_000, 0) - .saturating_add(Weight::from_parts(0, 18394)) - .saturating_add(T::DbWeight::get().reads(7)) - } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:2 w:1) - /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn notify_current_targets() -> Weight { - // Proof Size summary in bytes: - // Measured: `119` - // Estimated: `6059` - // Minimum execution time: 35_296_000 picoseconds. - Weight::from_parts(36_300_000, 0) - .saturating_add(Weight::from_parts(0, 6059)) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:5 w:0) - /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn notify_target_migration_fail() -> Weight { - // Proof Size summary in bytes: - // Measured: `79` - // Estimated: `13444` - // Minimum execution time: 18_067_000 picoseconds. - Weight::from_parts(18_628_000, 0) - .saturating_add(Weight::from_parts(0, 13444)) - .saturating_add(T::DbWeight::get().reads(5)) - } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:2) - /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn migrate_version_notify_targets() -> Weight { - // Proof Size summary in bytes: - // Measured: `34` - // Estimated: `15874` - // Minimum execution time: 20_389_000 picoseconds. - Weight::from_parts(21_258_000, 0) - .saturating_add(Weight::from_parts(0, 15874)) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `PolkadotXcm::VersionNotifyTargets` (r:6 w:1) - /// Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - /// Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - /// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - /// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - /// Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - fn migrate_and_notify_old_targets() -> Weight { - // Proof Size summary in bytes: - // Measured: `119` - // Estimated: `15959` - // Minimum execution time: 45_440_000 picoseconds. - Weight::from_parts(47_521_000, 0) - .saturating_add(Weight::from_parts(0, 15959)) - .saturating_add(T::DbWeight::get().reads(9)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) - /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `PolkadotXcm::Queries` (r:0 w:1) - /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn new_query() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `1485` - // Minimum execution time: 2_671_000 picoseconds. - Weight::from_parts(2_797_000, 0) - .saturating_add(Weight::from_parts(0, 1485)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: `PolkadotXcm::Queries` (r:1 w:1) - /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn take_response() -> Weight { - // Proof Size summary in bytes: - // Measured: `7576` - // Estimated: `11041` - // Minimum execution time: 27_233_000 picoseconds. - Weight::from_parts(27_764_000, 0) - .saturating_add(Weight::from_parts(0, 11041)) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `PolkadotXcm::ShouldRecordXcm` (r:1 w:0) - /// Proof: `PolkadotXcm::ShouldRecordXcm` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) - /// Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn claim_assets() -> Weight { - // Proof Size summary in bytes: - // Measured: `24` - // Estimated: `3489` - // Minimum execution time: 39_700_000 picoseconds. - Weight::from_parts(40_687_000, 0) - .saturating_add(Weight::from_parts(0, 3489)) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(1)) - } - /// Storage: `Benchmark::Override` (r:0 w:0) - /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn add_authorized_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. - Weight::from_parts(18_446_744_073_709_551_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - /// Storage: `Benchmark::Override` (r:0 w:0) - /// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) - fn remove_authorized_alias() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. - Weight::from_parts(18_446_744_073_709_551_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } - fn weigh_message() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 8_080_000 picoseconds. - Weight::from_parts(8_385_000, 0) - .saturating_add(Weight::from_parts(0, 0)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/paritydb_weights.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/paritydb_weights.rs deleted file mode 100644 index db09e9de7bdf4..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/paritydb_weights.rs +++ /dev/null @@ -1,63 +0,0 @@ -// This file is part of Cumulus. - -// Copyright (C) 2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -pub mod constants { - use frame_support::{ - parameter_types, - weights::{constants, RuntimeDbWeight}, - }; - - parameter_types! { - /// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights - /// are available for brave runtime engineers who may want to try this out as default. - pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 8_000 * constants::WEIGHT_REF_TIME_PER_NANOS, - write: 50_000 * constants::WEIGHT_REF_TIME_PER_NANOS, - }; - } - - #[cfg(test)] - mod test_db_weights { - use super::constants::ParityDbWeight as W; - use frame_support::weights::constants; - - /// Checks that all weights exist and have sane values. - // NOTE: If this test fails but you are sure that the generated values are fine, - // you can delete it. - #[test] - fn sane() { - // At least 1 µs. - assert!( - W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, - "Read weight should be at least 1 µs." - ); - assert!( - W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, - "Write weight should be at least 1 µs." - ); - // At most 1 ms. - assert!( - W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, - "Read weight should be at most 1 ms." - ); - assert!( - W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, - "Write weight should be at most 1 ms." - ); - } - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/polkadot_runtime_common_identity_migrator.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/polkadot_runtime_common_identity_migrator.rs deleted file mode 100644 index 7446d57279c3f..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/polkadot_runtime_common_identity_migrator.rs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `polkadot_runtime_common::identity_migrator` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `afc679a858d4`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=polkadot_runtime_common::identity_migrator -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![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 `polkadot_runtime_common::identity_migrator`. -pub struct WeightInfo(PhantomData); -impl polkadot_runtime_common::identity_migrator::WeightInfo for WeightInfo { - /// Storage: `Identity::IdentityOf` (r:1 w:1) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(804), added: 3279, mode: `MaxEncodedLen`) - /// Storage: `Identity::SubsOf` (r:1 w:1) - /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(3258), added: 5733, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Identity::SuperOf` (r:0 w:100) - /// Proof: `Identity::SuperOf` (`max_values`: None, `max_size`: Some(114), added: 2589, mode: `MaxEncodedLen`) - /// The range of component `r` is `[0, 20]`. - /// The range of component `s` is `[0, 100]`. - fn reap_identity(r: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `673 + r * (5 ±0) + s * (32 ±0)` - // Estimated: `6723` - // Minimum execution time: 35_063_000 picoseconds. - Weight::from_parts(34_643_325, 0) - .saturating_add(Weight::from_parts(0, 6723)) - // Standard Error: 15_530 - .saturating_add(Weight::from_parts(259_757, 0).saturating_mul(r.into())) - // Standard Error: 3_181 - .saturating_add(Weight::from_parts(1_506_816, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(s.into()))) - } - /// Storage: `Identity::IdentityOf` (r:1 w:1) - /// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(804), added: 3279, mode: `MaxEncodedLen`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `Identity::SubsOf` (r:1 w:1) - /// Proof: `Identity::SubsOf` (`max_values`: None, `max_size`: Some(3258), added: 5733, mode: `MaxEncodedLen`) - fn poke_deposit() -> Weight { - // Proof Size summary in bytes: - // Measured: `634` - // Estimated: `6723` - // Minimum execution time: 47_179_000 picoseconds. - Weight::from_parts(48_906_000, 0) - .saturating_add(Weight::from_parts(0, 6723)) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/rocksdb_weights.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/rocksdb_weights.rs deleted file mode 100644 index 855ec356bca93..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/rocksdb_weights.rs +++ /dev/null @@ -1,63 +0,0 @@ -// This file is part of Cumulus. - -// Copyright (C) 2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -pub mod constants { - use frame_support::{ - parameter_types, - weights::{constants, RuntimeDbWeight}, - }; - - parameter_types! { - /// By default, Substrate uses `RocksDB`, so this will be the weight used throughout - /// the runtime. - pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight { - read: 25_000 * constants::WEIGHT_REF_TIME_PER_NANOS, - write: 100_000 * constants::WEIGHT_REF_TIME_PER_NANOS, - }; - } - - #[cfg(test)] - mod test_db_weights { - use super::constants::RocksDbWeight as W; - use frame_support::weights::constants; - - /// Checks that all weights exist and have sane values. - // NOTE: If this test fails but you are sure that the generated values are fine, - // you can delete it. - #[test] - fn sane() { - // At least 1 µs. - assert!( - W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, - "Read weight should be at least 1 µs." - ); - assert!( - W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS, - "Write weight should be at least 1 µs." - ); - // At most 1 ms. - assert!( - W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, - "Read weight should be at most 1 ms." - ); - assert!( - W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS, - "Write weight should be at most 1 ms." - ); - } - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/mod.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/mod.rs deleted file mode 100644 index 41c773db7c766..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/mod.rs +++ /dev/null @@ -1,272 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -mod pallet_xcm_benchmarks_fungible; -mod pallet_xcm_benchmarks_generic; - -use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; -use alloc::vec::Vec; -use frame_support::weights::Weight; -use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; -use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; -use sp_runtime::BoundedVec; -use xcm::{ - latest::{prelude::*, AssetTransferFilter}, - DoubleEncoded, -}; - -trait WeighAssets { - fn weigh_assets(&self, weight: Weight) -> Weight; -} - -const MAX_ASSETS: u64 = 100; - -impl WeighAssets for AssetFilter { - fn weigh_assets(&self, weight: Weight) -> Weight { - match self { - Self::Definite(assets) => weight.saturating_mul(assets.inner().iter().count() as u64), - Self::Wild(asset) => match asset { - All => weight.saturating_mul(MAX_ASSETS), - AllOf { fun, .. } => match fun { - WildFungibility::Fungible => weight, - // Magic number 2 has to do with the fact that we could have up to 2 times - // MaxAssetsIntoHolding in the worst-case scenario. - WildFungibility::NonFungible => - weight.saturating_mul((MaxAssetsIntoHolding::get() * 2) as u64), - }, - AllCounted(count) => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - AllOfCounted { count, .. } => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - }, - } - } -} - -impl WeighAssets for Assets { - fn weigh_assets(&self, weight: Weight) -> Weight { - weight.saturating_mul(self.inner().iter().count() as u64) - } -} - -pub struct PeopleRococoXcmWeight(core::marker::PhantomData); -impl XcmWeightInfo for PeopleRococoXcmWeight { - fn withdraw_asset(assets: &Assets) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::withdraw_asset()) - } - fn reserve_asset_deposited(assets: &Assets) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::reserve_asset_deposited()) - } - fn receive_teleported_asset(assets: &Assets) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::receive_teleported_asset()) - } - fn query_response( - _query_id: &u64, - _response: &Response, - _max_weight: &Weight, - _querier: &Option, - ) -> Weight { - XcmGeneric::::query_response() - } - fn transfer_asset(assets: &Assets, _dest: &Location) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::transfer_asset()) - } - fn transfer_reserve_asset(assets: &Assets, _dest: &Location, _xcm: &Xcm<()>) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::transfer_reserve_asset()) - } - fn transact( - _origin_type: &OriginKind, - _fallback_max_weight: &Option, - _call: &DoubleEncoded, - ) -> Weight { - XcmGeneric::::transact() - } - fn hrmp_new_channel_open_request( - _sender: &u32, - _max_message_size: &u32, - _max_capacity: &u32, - ) -> Weight { - // XCM Executor does not currently support HRMP channel operations - Weight::MAX - } - fn hrmp_channel_accepted(_recipient: &u32) -> Weight { - // XCM Executor does not currently support HRMP channel operations - Weight::MAX - } - fn hrmp_channel_closing(_initiator: &u32, _sender: &u32, _recipient: &u32) -> Weight { - // XCM Executor does not currently support HRMP channel operations - Weight::MAX - } - fn clear_origin() -> Weight { - XcmGeneric::::clear_origin() - } - fn descend_origin(_who: &InteriorLocation) -> Weight { - XcmGeneric::::descend_origin() - } - fn report_error(_query_response_info: &QueryResponseInfo) -> Weight { - XcmGeneric::::report_error() - } - fn deposit_asset(assets: &AssetFilter, _dest: &Location) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::deposit_asset()) - } - fn deposit_reserve_asset(assets: &AssetFilter, _dest: &Location, _xcm: &Xcm<()>) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::deposit_reserve_asset()) - } - fn exchange_asset(_give: &AssetFilter, _receive: &Assets, _maximal: &bool) -> Weight { - Weight::MAX - } - fn initiate_reserve_withdraw( - assets: &AssetFilter, - _reserve: &Location, - _xcm: &Xcm<()>, - ) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::initiate_reserve_withdraw()) - } - fn initiate_teleport(assets: &AssetFilter, _dest: &Location, _xcm: &Xcm<()>) -> Weight { - assets.weigh_assets(XcmFungibleWeight::::initiate_teleport()) - } - fn initiate_transfer( - _dest: &Location, - remote_fees: &Option, - _preserve_origin: &bool, - assets: &BoundedVec, - _xcm: &Xcm<()>, - ) -> Weight { - let mut weight = if let Some(remote_fees) = remote_fees { - let fees = remote_fees.inner(); - fees.weigh_assets(XcmFungibleWeight::::initiate_transfer()) - } else { - Weight::zero() - }; - for asset_filter in assets { - let assets = asset_filter.inner(); - let extra = assets.weigh_assets(XcmFungibleWeight::::initiate_transfer()); - weight = weight.saturating_add(extra); - } - weight - } - fn report_holding(_response_info: &QueryResponseInfo, _assets: &AssetFilter) -> Weight { - XcmGeneric::::report_holding() - } - fn buy_execution(_fees: &Asset, _weight_limit: &WeightLimit) -> Weight { - XcmGeneric::::buy_execution() - } - fn pay_fees(_asset: &Asset) -> Weight { - XcmGeneric::::pay_fees() - } - fn refund_surplus() -> Weight { - XcmGeneric::::refund_surplus() - } - fn set_error_handler(_xcm: &Xcm) -> Weight { - XcmGeneric::::set_error_handler() - } - fn set_appendix(_xcm: &Xcm) -> Weight { - XcmGeneric::::set_appendix() - } - fn clear_error() -> Weight { - XcmGeneric::::clear_error() - } - fn claim_asset(_assets: &Assets, _ticket: &Location) -> Weight { - XcmGeneric::::claim_asset() - } - fn trap(_code: &u64) -> Weight { - XcmGeneric::::trap() - } - fn subscribe_version(_query_id: &QueryId, _max_response_weight: &Weight) -> Weight { - XcmGeneric::::subscribe_version() - } - fn unsubscribe_version() -> Weight { - XcmGeneric::::unsubscribe_version() - } - fn burn_asset(assets: &Assets) -> Weight { - assets.weigh_assets(XcmGeneric::::burn_asset()) - } - fn expect_asset(assets: &Assets) -> Weight { - assets.weigh_assets(XcmGeneric::::expect_asset()) - } - fn expect_origin(_origin: &Option) -> Weight { - XcmGeneric::::expect_origin() - } - fn expect_error(_error: &Option<(u32, XcmError)>) -> Weight { - XcmGeneric::::expect_error() - } - fn expect_transact_status(_transact_status: &MaybeErrorCode) -> Weight { - XcmGeneric::::expect_transact_status() - } - fn query_pallet(_module_name: &Vec, _response_info: &QueryResponseInfo) -> Weight { - XcmGeneric::::query_pallet() - } - fn expect_pallet( - _index: &u32, - _name: &Vec, - _module_name: &Vec, - _crate_major: &u32, - _min_crate_minor: &u32, - ) -> Weight { - XcmGeneric::::expect_pallet() - } - fn report_transact_status(_response_info: &QueryResponseInfo) -> Weight { - XcmGeneric::::report_transact_status() - } - fn clear_transact_status() -> Weight { - XcmGeneric::::clear_transact_status() - } - fn universal_origin(_: &Junction) -> Weight { - Weight::MAX - } - fn export_message(_: &NetworkId, _: &Junctions, _: &Xcm<()>) -> Weight { - Weight::MAX - } - fn lock_asset(_: &Asset, _: &Location) -> Weight { - Weight::MAX - } - fn unlock_asset(_: &Asset, _: &Location) -> Weight { - Weight::MAX - } - fn note_unlockable(_: &Asset, _: &Location) -> Weight { - Weight::MAX - } - fn request_unlock(_: &Asset, _: &Location) -> Weight { - Weight::MAX - } - fn set_fees_mode(_: &bool) -> Weight { - XcmGeneric::::set_fees_mode() - } - fn set_topic(_topic: &[u8; 32]) -> Weight { - XcmGeneric::::set_topic() - } - fn clear_topic() -> Weight { - XcmGeneric::::clear_topic() - } - fn alias_origin(_: &Location) -> Weight { - // XCM Executor does not currently support alias origin operations - Weight::MAX - } - fn unpaid_execution(_: &WeightLimit, _: &Option) -> Weight { - XcmGeneric::::unpaid_execution() - } - fn set_hints(hints: &BoundedVec) -> Weight { - let mut weight = Weight::zero(); - for hint in hints { - match hint { - AssetClaimer { .. } => { - weight = weight.saturating_add(XcmGeneric::::asset_claimer()); - }, - } - } - weight - } - fn execute_with_origin(_: &Option, _: &Xcm) -> Weight { - XcmGeneric::::execute_with_origin() - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs deleted file mode 100644 index ddeed67df499e..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_xcm_benchmarks::fungible` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=pallet_xcm_benchmarks::fungible -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --template=cumulus/templates/xcm-bench-template.hbs -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use core::marker::PhantomData; - -/// Weights for `pallet_xcm_benchmarks::fungible`. -pub struct WeightInfo(PhantomData); -impl WeightInfo { - // Storage: `System::Account` (r:1 w:1) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - pub fn withdraw_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `101` - // Estimated: `3593` - // Minimum execution time: 30_722_000 picoseconds. - Weight::from_parts(31_547_000, 3593) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: `System::Account` (r:2 w:2) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - pub fn transfer_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `101` - // Estimated: `6196` - // Minimum execution time: 41_885_000 picoseconds. - Weight::from_parts(42_845_000, 6196) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - // Storage: `System::Account` (r:3 w:3) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn transfer_reserve_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `345` - // Estimated: `8799` - // Minimum execution time: 110_100_000 picoseconds. - Weight::from_parts(112_319_000, 8799) - .saturating_add(T::DbWeight::get().reads(8)) - .saturating_add(T::DbWeight::get().writes(5)) - } - // Storage: `Benchmark::Override` (r:0 w:0) - // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) - pub fn reserve_asset_deposited() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. - Weight::from_parts(18_446_744_073_709_551_000, 0) - } - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `System::Account` (r:2 w:2) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn initiate_reserve_withdraw() -> Weight { - // Proof Size summary in bytes: - // Measured: `345` - // Estimated: `6196` - // Minimum execution time: 79_690_000 picoseconds. - Weight::from_parts(82_281_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - pub fn receive_teleported_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 2_748_000 picoseconds. - Weight::from_parts(2_919_000, 0) - } - // Storage: `System::Account` (r:1 w:1) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - pub fn deposit_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 24_264_000 picoseconds. - Weight::from_parts(24_701_000, 3593) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `System::Account` (r:1 w:1) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn deposit_reserve_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `244` - // Estimated: `3709` - // Minimum execution time: 68_727_000 picoseconds. - Weight::from_parts(70_944_000, 3709) - .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(3)) - } - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn initiate_teleport() -> Weight { - // Proof Size summary in bytes: - // Measured: `244` - // Estimated: `3709` - // Minimum execution time: 48_495_000 picoseconds. - Weight::from_parts(49_936_000, 3709) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(2)) - } - // Storage: `System::Account` (r:2 w:2) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn initiate_transfer() -> Weight { - // Proof Size summary in bytes: - // Measured: `244` - // Estimated: `6196` - // Minimum execution time: 94_270_000 picoseconds. - Weight::from_parts(96_465_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs deleted file mode 100644 index 37dba06cb564b..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ /dev/null @@ -1,368 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for `pallet_xcm_benchmarks::generic` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2025-07-30, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `a49f76527979`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` -//! WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 - -// Executed Command: -// frame-omni-bencher -// v1 -// benchmark -// pallet -// --extrinsic=* -// --runtime=target/production/wbuild/people-rococo-runtime/people_rococo_runtime.wasm -// --pallet=pallet_xcm_benchmarks::generic -// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt -// --output=./cumulus/parachains/runtimes/people/people-rococo/src/weights/xcm -// --wasm-execution=compiled -// --steps=50 -// --repeat=20 -// --heap-pages=4096 -// --template=cumulus/templates/xcm-bench-template.hbs -// --no-storage-info -// --no-min-squares -// --no-median-slopes - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use core::marker::PhantomData; - -/// Weights for `pallet_xcm_benchmarks::generic`. -pub struct WeightInfo(PhantomData); -impl WeightInfo { - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `System::Account` (r:2 w:2) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn report_holding() -> Weight { - // Proof Size summary in bytes: - // Measured: `345` - // Estimated: `6196` - // Minimum execution time: 76_734_000 picoseconds. - Weight::from_parts(79_192_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - // Storage: `System::Account` (r:1 w:1) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - pub fn buy_execution() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 3_824_000 picoseconds. - Weight::from_parts(4_021_000, 3593) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: `System::Account` (r:1 w:1) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - pub fn pay_fees() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3593` - // Minimum execution time: 3_653_000 picoseconds. - Weight::from_parts(3_956_000, 3593) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - pub fn asset_claimer() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 754_000 picoseconds. - Weight::from_parts(805_000, 0) - } - // Storage: `PolkadotXcm::Queries` (r:1 w:0) - // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) - pub fn query_response() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `3465` - // Minimum execution time: 5_858_000 picoseconds. - Weight::from_parts(6_017_000, 3465) - .saturating_add(T::DbWeight::get().reads(1)) - } - pub fn transact() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 7_376_000 picoseconds. - Weight::from_parts(7_673_000, 0) - } - pub fn refund_surplus() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_183_000 picoseconds. - Weight::from_parts(1_246_000, 0) - } - pub fn set_error_handler() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 742_000 picoseconds. - Weight::from_parts(801_000, 0) - } - pub fn set_appendix() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 727_000 picoseconds. - Weight::from_parts(786_000, 0) - } - pub fn clear_error() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 675_000 picoseconds. - Weight::from_parts(729_000, 0) - } - pub fn descend_origin() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 764_000 picoseconds. - Weight::from_parts(793_000, 0) - } - // Storage: `Benchmark::Override` (r:0 w:0) - // Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`) - pub fn execute_with_origin() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 18_446_744_073_709_551_000 picoseconds. - Weight::from_parts(18_446_744_073_709_551_000, 0) - } - pub fn clear_origin() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 663_000 picoseconds. - Weight::from_parts(752_000, 0) - } - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `System::Account` (r:2 w:2) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn report_error() -> Weight { - // Proof Size summary in bytes: - // Measured: `345` - // Estimated: `6196` - // Minimum execution time: 73_512_000 picoseconds. - Weight::from_parts(75_381_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - // Storage: `PolkadotXcm::AssetTraps` (r:1 w:1) - // Proof: `PolkadotXcm::AssetTraps` (`max_values`: None, `max_size`: None, mode: `Measured`) - pub fn claim_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `24` - // Estimated: `3489` - // Minimum execution time: 9_359_000 picoseconds. - Weight::from_parts(9_823_000, 3489) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - pub fn trap() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_402_000 picoseconds. - Weight::from_parts(3_585_000, 0) - } - // Storage: `PolkadotXcm::VersionNotifyTargets` (r:1 w:1) - // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn subscribe_version() -> Weight { - // Proof Size summary in bytes: - // Measured: `175` - // Estimated: `3640` - // Minimum execution time: 31_686_000 picoseconds. - Weight::from_parts(32_742_000, 3640) - .saturating_add(T::DbWeight::get().reads(5)) - .saturating_add(T::DbWeight::get().writes(3)) - } - // Storage: `PolkadotXcm::VersionNotifyTargets` (r:0 w:1) - // Proof: `PolkadotXcm::VersionNotifyTargets` (`max_values`: None, `max_size`: None, mode: `Measured`) - pub fn unsubscribe_version() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_091_000 picoseconds. - Weight::from_parts(3_327_000, 0) - .saturating_add(T::DbWeight::get().writes(1)) - } - pub fn burn_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 1_069_000 picoseconds. - Weight::from_parts(1_126_000, 0) - } - pub fn expect_asset() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 769_000 picoseconds. - Weight::from_parts(847_000, 0) - } - pub fn expect_origin() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_459_000 picoseconds. - Weight::from_parts(3_616_000, 0) - } - pub fn expect_error() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_456_000 picoseconds. - Weight::from_parts(3_631_000, 0) - } - pub fn expect_transact_status() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 846_000 picoseconds. - Weight::from_parts(925_000, 0) - } - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `System::Account` (r:2 w:2) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn query_pallet() -> Weight { - // Proof Size summary in bytes: - // Measured: `345` - // Estimated: `6196` - // Minimum execution time: 77_788_000 picoseconds. - Weight::from_parts(80_423_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - pub fn expect_pallet() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 3_723_000 picoseconds. - Weight::from_parts(3_891_000, 0) - } - // Storage: `ParachainInfo::ParachainId` (r:1 w:0) - // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::DeliveryFeeFactor` (r:1 w:0) - // Proof: `XcmpQueue::DeliveryFeeFactor` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) - // Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0) - // Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) - // Storage: `System::Account` (r:2 w:2) - // Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - // Storage: `ParachainSystem::RelevantMessagingState` (r:1 w:0) - // Proof: `ParachainSystem::RelevantMessagingState` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - // Storage: `XcmpQueue::OutboundXcmpStatus` (r:1 w:1) - // Proof: `XcmpQueue::OutboundXcmpStatus` (`max_values`: Some(1), `max_size`: Some(1282), added: 1777, mode: `MaxEncodedLen`) - // Storage: `XcmpQueue::OutboundXcmpMessages` (r:0 w:1) - // Proof: `XcmpQueue::OutboundXcmpMessages` (`max_values`: None, `max_size`: Some(105506), added: 107981, mode: `MaxEncodedLen`) - pub fn report_transact_status() -> Weight { - // Proof Size summary in bytes: - // Measured: `345` - // Estimated: `6196` - // Minimum execution time: 74_903_000 picoseconds. - Weight::from_parts(76_835_000, 6196) - .saturating_add(T::DbWeight::get().reads(7)) - .saturating_add(T::DbWeight::get().writes(4)) - } - pub fn clear_transact_status() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 715_000 picoseconds. - Weight::from_parts(786_000, 0) - } - pub fn set_topic() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 686_000 picoseconds. - Weight::from_parts(741_000, 0) - } - pub fn clear_topic() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 677_000 picoseconds. - Weight::from_parts(738_000, 0) - } - pub fn set_fees_mode() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 687_000 picoseconds. - Weight::from_parts(745_000, 0) - } - pub fn unpaid_execution() -> Weight { - // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 704_000 picoseconds. - Weight::from_parts(748_000, 0) - } -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/src/xcm_config.rs b/cumulus/parachains/runtimes/people/people-rococo/src/xcm_config.rs deleted file mode 100644 index 8f2a89a268ee2..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/src/xcm_config.rs +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use super::{ - AccountId, AllPalletsWithSystem, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, - Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, -}; -use crate::{TransactionByteFee, CENTS}; -use frame_support::{ - parameter_types, - traits::{ - tokens::imbalance::ResolveTo, ConstU32, Contains, Disabled, Equals, Everything, Nothing, - }, -}; -use frame_system::EnsureRoot; -use pallet_collator_selection::StakingPotAccountId; -use pallet_xcm::XcmPassthrough; -use parachains_common::{ - xcm_config::{ - AllSiblingSystemParachains, ConcreteAssetFromSystem, ParentRelayOrSiblingParachains, - RelayOrOtherSystemParachains, - }, - TREASURY_PALLET_ID, -}; -use polkadot_parachain_primitives::primitives::Sibling; -use sp_runtime::traits::AccountIdConversion; -use xcm::latest::{prelude::*, ROCOCO_GENESIS_HASH}; -use xcm_builder::{ - AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowHrmpNotificationsFromRelayChain, - AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, - DenyRecursively, DenyReserveTransferToRelayChain, DenyThenTry, DescribeAllTerminal, - DescribeFamily, DescribeTerminus, EnsureXcmOrigin, FrameTransactionalProcessor, - FungibleAdapter, HashedDescription, IsConcrete, ParentAsSuperuser, ParentIsPreset, - RelayChainAsNative, SendXcmFeeToAccount, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, - XcmFeeManagerFromComponents, -}; -use xcm_executor::XcmExecutor; - -parameter_types! { - pub const RootLocation: Location = Location::here(); - pub const RelayLocation: Location = Location::parent(); - pub const RelayNetwork: Option = Some(NetworkId::ByGenesis(ROCOCO_GENESIS_HASH)); - pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorLocation = - [GlobalConsensus(RelayNetwork::get().unwrap()), Parachain(ParachainInfo::parachain_id().into())].into(); - pub const MaxInstructions: u32 = 100; - pub const MaxAssetsIntoHolding: u32 = 64; - pub const GovernanceLocation: Location = Location::parent(); - pub const FellowshipLocation: Location = Location::parent(); - /// The asset ID for the asset that we use to pay for message delivery fees. Just ROC. - pub FeeAssetId: AssetId = AssetId(RelayLocation::get()); - /// The base fee for the message delivery fees. - pub const BaseDeliveryFee: u128 = CENTS.saturating_mul(3); - pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating(); - pub RelayTreasuryLocation: Location = - (Parent, PalletInstance(rococo_runtime_constants::TREASURY_PALLET_ID)).into(); -} - -pub type PriceForParentDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice< - FeeAssetId, - BaseDeliveryFee, - TransactionByteFee, - ParachainSystem, ->; - -pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice< - FeeAssetId, - BaseDeliveryFee, - TransactionByteFee, - XcmpQueue, ->; - -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. -pub type LocationToAccountId = ( - // The parent (Relay-chain) origin converts to the parent `AccountId`. - ParentIsPreset, - // Sibling parachain origins convert to AccountId via the `ParaId::into`. - SiblingParachainConvertsVia, - // Straight up local `AccountId32` origins just alias directly to `AccountId`. - AccountId32Aliases, - // Here/local root location to `AccountId`. - HashedDescription, - // Foreign locations alias into accounts according to a hash of their standard description. - HashedDescription>, -); - -/// Means for transacting the native currency on this chain. -pub type FungibleTransactor = FungibleAdapter< - // Use this currency: - Balances, - // Use this currency when it is a fungible asset matching the given location or name: - IsConcrete, - // Do a simple punn to convert an `AccountId32` `Location` into a native chain - // `AccountId`: - LocationToAccountId, - // Our chain's `AccountId` type (we can't get away without mentioning it explicitly): - AccountId, - // We don't track any teleports of `Balances`. - (), ->; - -/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with XCM's `Transact`. There is an `OriginKind` that can -/// bias the kind of local `Origin` it will become. -pub type XcmOriginToTransactDispatchOrigin = ( - // Sovereign account converter; this attempts to derive an `AccountId` from the origin location - // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for - // foreign chains who want to have a local sovereign account on this chain that they control. - SovereignSignedViaLocation, - // Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when - // recognized. - RelayChainAsNative, - // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when - // recognized. - SiblingParachainAsNative, - // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a - // transaction from the Root origin. - ParentAsSuperuser, - // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `RuntimeOrigin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, - // XCM origins can be represented natively under the XCM pallet's `Xcm` origin. - XcmPassthrough, -); - -pub struct LocalPlurality; -impl Contains for LocalPlurality { - fn contains(location: &Location) -> bool { - matches!(location.unpack(), (0, [Plurality { .. }])) - } -} - -pub struct ParentOrParentsPlurality; -impl Contains for ParentOrParentsPlurality { - fn contains(location: &Location) -> bool { - matches!(location.unpack(), (1, []) | (1, [Plurality { .. }])) - } -} - -pub type Barrier = TrailingSetTopicAsId< - DenyThenTry< - DenyRecursively, - ( - // Allow local users to buy weight credit. - TakeWeightCredit, - // Expected responses are OK. - AllowKnownQueryResponses, - WithComputedOrigin< - ( - // If the message is one that immediately attempts to pay for execution, then - // allow it. - AllowTopLevelPaidExecutionFrom, - // Parent and its pluralities (i.e. governance bodies) get free execution. - AllowExplicitUnpaidExecutionFrom, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, - // HRMP notifications from the relay chain are OK. - AllowHrmpNotificationsFromRelayChain, - ), - UniversalLocation, - ConstU32<8>, - >, - ), - >, ->; - -/// Locations that will not be charged fees in the executor, neither for execution nor delivery. We -/// only waive fees for system functions, which these locations represent. -pub type WaivedLocations = ( - RelayOrOtherSystemParachains, - Equals, - Equals, - LocalPlurality, -); - -pub struct XcmConfig; -impl xcm_executor::Config for XcmConfig { - type RuntimeCall = RuntimeCall; - type XcmSender = XcmRouter; - type XcmEventEmitter = PolkadotXcm; - type AssetTransactor = FungibleTransactor; - type OriginConverter = XcmOriginToTransactDispatchOrigin; - // People chain does not recognize a reserve location for any asset. Users must teleport ROC - // where allowed (e.g. with the Relay Chain). - type IsReserve = (); - /// Only allow teleportation of ROC. - type IsTeleporter = ConcreteAssetFromSystem; - type UniversalLocation = UniversalLocation; - type Barrier = Barrier; - type Weigher = WeightInfoBounds< - crate::weights::xcm::PeopleRococoXcmWeight, - RuntimeCall, - MaxInstructions, - >; - type Trader = UsingComponents< - WeightToFee, - RelayLocation, - AccountId, - Balances, - ResolveTo, Balances>, - >; - type ResponseHandler = PolkadotXcm; - type AssetTrap = PolkadotXcm; - type AssetClaims = PolkadotXcm; - type SubscriptionService = PolkadotXcm; - type PalletInstancesInfo = AllPalletsWithSystem; - type MaxAssetsIntoHolding = MaxAssetsIntoHolding; - type AssetLocker = (); - type AssetExchanger = (); - type FeeManager = XcmFeeManagerFromComponents< - WaivedLocations, - SendXcmFeeToAccount, - >; - type MessageExporter = (); - type UniversalAliases = Nothing; - type CallDispatcher = RuntimeCall; - type SafeCallFilter = Everything; - type Aliasers = Nothing; - type TransactionalProcessor = FrameTransactionalProcessor; - type HrmpNewChannelOpenRequestHandler = (); - type HrmpChannelAcceptedHandler = (); - type HrmpChannelClosingHandler = (); - type XcmRecorder = PolkadotXcm; -} - -/// Converts a local signed origin into an XCM location. Forms the basis for local origins -/// sending/executing XCMs. -pub type LocalOriginToLocation = SignedToAccountId32; - -/// The means for routing XCM messages which are not for local execution into the right message -/// queues. -pub type XcmRouter = WithUniqueTopic<( - // Two routers - use UMP to communicate with the relay chain: - cumulus_primitives_utility::ParentAsUmp, - // ..and XCMP to communicate with the sibling chains. - XcmpQueue, -)>; - -impl pallet_xcm::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - // We want to disallow users sending (arbitrary) XCM programs from this chain. - type SendXcmOrigin = EnsureXcmOrigin; - type XcmRouter = XcmRouter; - // We support local origins dispatching XCM executions. - type ExecuteXcmOrigin = EnsureXcmOrigin; - type XcmExecuteFilter = Everything; - type XcmExecutor = XcmExecutor; - type XcmTeleportFilter = Everything; - type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location. - type Weigher = WeightInfoBounds< - crate::weights::xcm::PeopleRococoXcmWeight, - RuntimeCall, - MaxInstructions, - >; - type UniversalLocation = UniversalLocation; - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; - type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; - type Currency = Balances; - type CurrencyMatcher = (); - type TrustedLockers = (); - type SovereignAccountOf = LocationToAccountId; - type MaxLockers = ConstU32<8>; - type WeightInfo = crate::weights::pallet_xcm::WeightInfo; - type AdminOrigin = EnsureRoot; - type MaxRemoteLockConsumers = ConstU32<0>; - type RemoteLockConsumerIdentifier = (); - // Aliasing is disabled: xcm_executor::Config::Aliasers is set to `Nothing`. - type AuthorizedAliasConsideration = Disabled; -} - -impl cumulus_pallet_xcm::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type XcmExecutor = XcmExecutor; -} diff --git a/cumulus/parachains/runtimes/people/people-rococo/tests/tests.rs b/cumulus/parachains/runtimes/people/people-rococo/tests/tests.rs deleted file mode 100644 index 066fc62129c06..0000000000000 --- a/cumulus/parachains/runtimes/people/people-rococo/tests/tests.rs +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// This file is part of Cumulus. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#![cfg(test)] - -use parachains_common::AccountId; -use people_rococo_runtime::{ - xcm_config::LocationToAccountId, Block, Runtime, RuntimeCall, RuntimeOrigin, -}; -use sp_core::crypto::Ss58Codec; -use testnet_parachains_constants::rococo::fee::WeightToFee; -use xcm::latest::prelude::*; -use xcm_runtime_apis::conversions::LocationToAccountHelper; - -const ALICE: [u8; 32] = [1u8; 32]; - -#[test] -fn location_conversion_works() { - // the purpose of hardcoded values is to catch an unintended location conversion logic change. - struct TestCase { - description: &'static str, - location: Location, - expected_account_id_str: &'static str, - } - - let test_cases = vec![ - // DescribeTerminus - TestCase { - description: "DescribeTerminus Parent", - location: Location::new(1, Here), - expected_account_id_str: "5Dt6dpkWPwLaH4BBCKJwjiWrFVAGyYk3tLUabvyn4v7KtESG", - }, - TestCase { - description: "DescribeTerminus Sibling", - location: Location::new(1, [Parachain(1111)]), - expected_account_id_str: "5Eg2fnssmmJnF3z1iZ1NouAuzciDaaDQH7qURAy3w15jULDk", - }, - // DescribePalletTerminal - TestCase { - description: "DescribePalletTerminal Parent", - location: Location::new(1, [PalletInstance(50)]), - expected_account_id_str: "5CnwemvaAXkWFVwibiCvf2EjqwiqBi29S5cLLydZLEaEw6jZ", - }, - TestCase { - description: "DescribePalletTerminal Sibling", - location: Location::new(1, [Parachain(1111), PalletInstance(50)]), - expected_account_id_str: "5GFBgPjpEQPdaxEnFirUoa51u5erVx84twYxJVuBRAT2UP2g", - }, - // DescribeAccountId32Terminal - TestCase { - description: "DescribeAccountId32Terminal Parent", - location: Location::new( - 1, - [Junction::AccountId32 { network: None, id: AccountId::from(ALICE).into() }], - ), - expected_account_id_str: "5DN5SGsuUG7PAqFL47J9meViwdnk9AdeSWKFkcHC45hEzVz4", - }, - TestCase { - description: "DescribeAccountId32Terminal Sibling", - location: Location::new( - 1, - [ - Parachain(1111), - Junction::AccountId32 { network: None, id: AccountId::from(ALICE).into() }, - ], - ), - expected_account_id_str: "5DGRXLYwWGce7wvm14vX1Ms4Vf118FSWQbJkyQigY2pfm6bg", - }, - // DescribeAccountKey20Terminal - TestCase { - description: "DescribeAccountKey20Terminal Parent", - location: Location::new(1, [AccountKey20 { network: None, key: [0u8; 20] }]), - expected_account_id_str: "5F5Ec11567pa919wJkX6VHtv2ZXS5W698YCW35EdEbrg14cg", - }, - TestCase { - description: "DescribeAccountKey20Terminal Sibling", - location: Location::new( - 1, - [Parachain(1111), AccountKey20 { network: None, key: [0u8; 20] }], - ), - expected_account_id_str: "5CB2FbUds2qvcJNhDiTbRZwiS3trAy6ydFGMSVutmYijpPAg", - }, - // DescribeTreasuryVoiceTerminal - TestCase { - description: "DescribeTreasuryVoiceTerminal Parent", - location: Location::new(1, [Plurality { id: BodyId::Treasury, part: BodyPart::Voice }]), - expected_account_id_str: "5CUjnE2vgcUCuhxPwFoQ5r7p1DkhujgvMNDHaF2bLqRp4D5F", - }, - TestCase { - description: "DescribeTreasuryVoiceTerminal Sibling", - location: Location::new( - 1, - [Parachain(1111), Plurality { id: BodyId::Treasury, part: BodyPart::Voice }], - ), - expected_account_id_str: "5G6TDwaVgbWmhqRUKjBhRRnH4ry9L9cjRymUEmiRsLbSE4gB", - }, - // DescribeBodyTerminal - TestCase { - description: "DescribeBodyTerminal Parent", - location: Location::new(1, [Plurality { id: BodyId::Unit, part: BodyPart::Voice }]), - expected_account_id_str: "5EBRMTBkDisEXsaN283SRbzx9Xf2PXwUxxFCJohSGo4jYe6B", - }, - TestCase { - description: "DescribeBodyTerminal Sibling", - location: Location::new( - 1, - [Parachain(1111), Plurality { id: BodyId::Unit, part: BodyPart::Voice }], - ), - expected_account_id_str: "5DBoExvojy8tYnHgLL97phNH975CyT45PWTZEeGoBZfAyRMH", - }, - ]; - - for tc in test_cases { - let expected = - AccountId::from_string(tc.expected_account_id_str).expect("Invalid AccountId string"); - - let got = LocationToAccountHelper::::convert_location( - tc.location.into(), - ) - .unwrap(); - - assert_eq!(got, expected, "{}", tc.description); - } -} - -#[test] -fn xcm_payment_api_works() { - parachains_runtimes_test_utils::test_cases::xcm_payment_api_with_native_token_works::< - Runtime, - RuntimeCall, - RuntimeOrigin, - Block, - WeightToFee, - >(); -} diff --git a/cumulus/parachains/runtimes/testing/rococo-parachain/Cargo.toml b/cumulus/parachains/runtimes/testing/rococo-parachain/Cargo.toml deleted file mode 100644 index b78a592c59593..0000000000000 --- a/cumulus/parachains/runtimes/testing/rococo-parachain/Cargo.toml +++ /dev/null @@ -1,148 +0,0 @@ -[package] -name = "rococo-parachain-runtime" -version = "0.6.0" -authors.workspace = true -edition.workspace = true -description = "Simple runtime used by the rococo parachain(s)" -license = "Apache-2.0" -homepage.workspace = true -repository.workspace = true - -[lints] -workspace = true - -[dependencies] -codec = { features = ["derive"], workspace = true } -scale-info = { features = ["derive"], workspace = true } -serde_json = { features = ["alloc"], workspace = true } - -# Substrate -frame-benchmarking = { optional = true, workspace = true } -frame-executive = { workspace = true } -frame-support = { workspace = true } -frame-system = { workspace = true } -frame-system-rpc-runtime-api = { workspace = true } -pallet-assets = { workspace = true } -pallet-aura = { workspace = true } -pallet-balances = { workspace = true } -pallet-sudo = { workspace = true } -pallet-timestamp = { workspace = true } -pallet-transaction-payment = { workspace = true } -pallet-transaction-payment-rpc-runtime-api = { workspace = true } -sp-api = { workspace = true } -sp-block-builder = { workspace = true } -sp-consensus-aura = { workspace = true } -sp-core = { workspace = true } -sp-genesis-builder = { workspace = true } -sp-inherents = { workspace = true } -sp-keyring = { workspace = true } -sp-offchain = { workspace = true } -sp-runtime = { workspace = true } -sp-session = { workspace = true } -sp-transaction-pool = { workspace = true } -sp-version = { workspace = true } - -# Polkadot -pallet-xcm = { workspace = true } -polkadot-parachain-primitives = { workspace = true } -polkadot-runtime-common = { workspace = true } -xcm = { workspace = true } -xcm-builder = { workspace = true } -xcm-executor = { workspace = true } - -# Cumulus -cumulus-pallet-aura-ext = { workspace = true } -cumulus-pallet-parachain-system = { workspace = true } -cumulus-pallet-weight-reclaim = { workspace = true } -cumulus-pallet-xcm = { workspace = true } -cumulus-pallet-xcmp-queue = { workspace = true } -cumulus-ping = { workspace = true } -cumulus-primitives-aura = { workspace = true } -cumulus-primitives-core = { workspace = true } -cumulus-primitives-utility = { workspace = true } -pallet-message-queue = { workspace = true } -parachain-info = { workspace = true } -parachains-common = { workspace = true } - -[build-dependencies] -substrate-wasm-builder = { optional = true, workspace = true, default-features = true } - -[features] -default = ["std"] -std = [ - "codec/std", - "cumulus-pallet-aura-ext/std", - "cumulus-pallet-parachain-system/std", - "cumulus-pallet-weight-reclaim/std", - "cumulus-pallet-xcm/std", - "cumulus-pallet-xcmp-queue/std", - "cumulus-ping/std", - "cumulus-primitives-aura/std", - "cumulus-primitives-core/std", - "cumulus-primitives-utility/std", - "frame-benchmarking?/std", - "frame-executive/std", - "frame-support/std", - "frame-system-rpc-runtime-api/std", - "frame-system/std", - "pallet-assets/std", - "pallet-aura/std", - "pallet-balances/std", - "pallet-message-queue/std", - "pallet-sudo/std", - "pallet-timestamp/std", - "pallet-transaction-payment-rpc-runtime-api/std", - "pallet-transaction-payment/std", - "pallet-xcm/std", - "parachain-info/std", - "parachains-common/std", - "polkadot-parachain-primitives/std", - "polkadot-runtime-common/std", - "scale-info/std", - "serde_json/std", - "sp-api/std", - "sp-block-builder/std", - "sp-consensus-aura/std", - "sp-core/std", - "sp-genesis-builder/std", - "sp-inherents/std", - "sp-keyring/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-transaction-pool/std", - "sp-version/std", - "substrate-wasm-builder", - "xcm-builder/std", - "xcm-executor/std", - "xcm/std", -] -runtime-benchmarks = [ - "cumulus-pallet-parachain-system/runtime-benchmarks", - "cumulus-pallet-weight-reclaim/runtime-benchmarks", - "cumulus-pallet-xcmp-queue/runtime-benchmarks", - "cumulus-primitives-core/runtime-benchmarks", - "cumulus-primitives-utility/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "pallet-assets/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-message-queue/runtime-benchmarks", - "pallet-sudo/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", - "pallet-transaction-payment/runtime-benchmarks", - "pallet-xcm/runtime-benchmarks", - "parachains-common/runtime-benchmarks", - "polkadot-parachain-primitives/runtime-benchmarks", - "polkadot-runtime-common/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", - "xcm-builder/runtime-benchmarks", - "xcm-executor/runtime-benchmarks", - "xcm/runtime-benchmarks", -] - -# A feature that should be enabled when the runtime should be built for on-chain -# deployment. This will disable stuff that shouldn't be part of the on-chain wasm -# to make it smaller, like logging for example. -on-chain-release-build = [] diff --git a/cumulus/parachains/runtimes/testing/rococo-parachain/build.rs b/cumulus/parachains/runtimes/testing/rococo-parachain/build.rs deleted file mode 100644 index 239ccac19ec77..0000000000000 --- a/cumulus/parachains/runtimes/testing/rococo-parachain/build.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#[cfg(feature = "std")] -fn main() { - substrate_wasm_builder::WasmBuilder::build_using_defaults(); -} - -#[cfg(not(feature = "std"))] -fn main() {} diff --git a/cumulus/parachains/runtimes/testing/rococo-parachain/src/genesis_config_presets.rs b/cumulus/parachains/runtimes/testing/rococo-parachain/src/genesis_config_presets.rs deleted file mode 100644 index befde799a45fc..0000000000000 --- a/cumulus/parachains/runtimes/testing/rococo-parachain/src/genesis_config_presets.rs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Rococo Parachain Runtime genesis config presets - -use crate::*; -use alloc::{vec, vec::Vec}; -use cumulus_primitives_core::ParaId; -use frame_support::build_struct_json_patch; -use parachains_common::{AccountId, AuraId}; -use sp_genesis_builder::PresetId; -use sp_keyring::Sr25519Keyring; - -const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION; - -const DEFAULT_PARA_ID: ParaId = ParaId::new(1000); -const ENDOWMENT: u128 = 1 << 60; - -fn rococo_parachain_genesis( - root_key: AccountId, - initial_authorities: Vec, - endowed_accounts: Vec, - endowment: Balance, - id: ParaId, -) -> serde_json::Value { - build_struct_json_patch!(RuntimeGenesisConfig { - aura: AuraConfig { authorities: initial_authorities }, - balances: BalancesConfig { - balances: endowed_accounts.iter().cloned().map(|k| (k, endowment)).collect(), - }, - parachain_info: ParachainInfoConfig { parachain_id: id }, - polkadot_xcm: PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION) }, - sudo: SudoConfig { key: Some(root_key) } - }) -} - -/// Provides the JSON representation of predefined genesis config for given `id`. -pub fn get_preset(id: &PresetId) -> Option> { - let genesis_fn = |authorities| { - rococo_parachain_genesis( - Sr25519Keyring::Alice.to_account_id(), - authorities, - Sr25519Keyring::well_known().map(|x| x.to_account_id()).collect(), - ENDOWMENT, - DEFAULT_PARA_ID, - ) - }; - - let patch = match id.as_ref() { - sp_genesis_builder::DEV_RUNTIME_PRESET => - genesis_fn(vec![Sr25519Keyring::Alice.public().into()]), - sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET => genesis_fn(vec![ - Sr25519Keyring::Alice.public().into(), - Sr25519Keyring::Bob.public().into(), - ]), - _ => return None, - }; - - Some( - serde_json::to_string(&patch) - .expect("serialization to json is expected to work. qed.") - .into_bytes(), - ) -} - -/// List of supported presets. -pub fn preset_names() -> Vec { - vec![ - PresetId::from(sp_genesis_builder::DEV_RUNTIME_PRESET), - PresetId::from(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET), - ] -} diff --git a/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs deleted file mode 100644 index 12a322534da5a..0000000000000 --- a/cumulus/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ /dev/null @@ -1,894 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// This file is part of Cumulus. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#![cfg_attr(not(feature = "std"), no_std)] -// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. -#![recursion_limit = "256"] - -// Make the WASM binary available. -#[cfg(feature = "std")] -include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); - -mod genesis_config_presets; - -extern crate alloc; - -use alloc::vec::Vec; -use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; -use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery; -use sp_api::impl_runtime_apis; -use sp_core::OpaqueMetadata; -use sp_runtime::{ - generic, impl_opaque_keys, - traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, Hash as HashT}, - transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, -}; -#[cfg(feature = "std")] -use sp_version::NativeVersion; -use sp_version::RuntimeVersion; - -// A few exports that help ease life for downstream crates. -pub use frame_support::{ - construct_runtime, derive_impl, - dispatch::DispatchClass, - genesis_builder_helper::{build_state, get_preset}, - parameter_types, - traits::{ - AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse, - Everything, IsInVec, Nothing, Randomness, - }, - weights::{ - constants::{ - BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND, - }, - ConstantMultiplier, IdentityFee, Weight, - }, - StorageValue, -}; -use frame_system::{ - limits::{BlockLength, BlockWeights}, - EnsureRoot, EnsureSigned, -}; -pub use pallet_balances::Call as BalancesCall; -pub use pallet_timestamp::Call as TimestampCall; -pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; -#[cfg(any(feature = "std", test))] -pub use sp_runtime::BuildStorage; -pub use sp_runtime::{Perbill, Permill}; - -use cumulus_primitives_core::{AggregateMessageOrigin, ParaId}; -use frame_support::traits::{Disabled, TransformOrigin}; -use parachains_common::{ - impls::{AssetsFrom, NonZeroIssuance}, - message_queue::{NarrowOriginToSibling, ParaIdToSibling}, - AccountId, AssetIdForTrustBackedAssets, Signature, -}; -use xcm_builder::{ - AllowHrmpNotificationsFromRelayChain, AllowKnownQueryResponses, AllowSubscriptionsFrom, - AsPrefixedGeneralIndex, ConvertedConcreteId, FrameTransactionalProcessor, FungiblesAdapter, - LocalMint, TrailingSetTopicAsId, WithUniqueTopic, -}; -use xcm_executor::traits::JustTry; - -// XCM imports -use pallet_xcm::{EnsureXcm, IsMajorityOfBody, XcmPassthrough}; -use polkadot_parachain_primitives::primitives::Sibling; -use xcm::latest::{prelude::*, ROCOCO_GENESIS_HASH}; -use xcm_builder::{ - AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom, - EnsureXcmOrigin, FixedWeightBounds, FungibleAdapter, IsConcrete, NativeAsset, - ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, - SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, -}; -use xcm_executor::XcmExecutor; - -pub type SessionHandlers = (); - -impl_opaque_keys! { - pub struct SessionKeys { - pub aura: Aura, - } -} - -/// This runtime version. -#[sp_version::runtime_version] -pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: alloc::borrow::Cow::Borrowed("test-parachain"), - impl_name: alloc::borrow::Cow::Borrowed("test-parachain"), - authoring_version: 1, - spec_version: 1_020_001, - impl_version: 0, - apis: RUNTIME_API_VERSIONS, - transaction_version: 6, - system_version: 0, -}; - -pub const MILLISECS_PER_BLOCK: u64 = 6000; - -pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; - -pub const EPOCH_DURATION_IN_BLOCKS: u32 = 10 * MINUTES; - -// These time units are defined in number of blocks. -pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); -pub const HOURS: BlockNumber = MINUTES * 60; -pub const DAYS: BlockNumber = HOURS * 24; - -pub const ROC: Balance = 1_000_000_000_000; -pub const MILLIROC: Balance = 1_000_000_000; -pub const MICROROC: Balance = 1_000_000; - -// 1 in 4 blocks (on average, not counting collisions) will be primary babe blocks. -pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4); - -/// The version information used to identify this runtime when compiled natively. -#[cfg(feature = "std")] -pub fn native_version() -> NativeVersion { - NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } -} - -/// We assume that ~10% of the block weight is consumed by `on_initialize` handlers. -/// This is used to limit the maximal weight of a single extrinsic. -const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); -/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used -/// by Operational extrinsics. -const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); -/// We allow for 2 seconds of compute with a 6 second average block time. -const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( - WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), - cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64, -); - -/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included -/// into the relay chain. -const UNINCLUDED_SEGMENT_CAPACITY: u32 = 3; -/// How many parachain blocks are processed by the relay chain per parent. Limits the -/// number of blocks authored per slot. -const BLOCK_PROCESSING_VELOCITY: u32 = 2; -/// Relay chain slot duration, in milliseconds. -const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000; - -parameter_types! { - pub const BlockHashCount: BlockNumber = 250; - pub const Version: RuntimeVersion = VERSION; - pub RuntimeBlockLength: BlockLength = - BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); - pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder() - .base_block(BlockExecutionWeight::get()) - .for_class(DispatchClass::all(), |weights| { - weights.base_extrinsic = ExtrinsicBaseWeight::get(); - }) - .for_class(DispatchClass::Normal, |weights| { - weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT); - }) - .for_class(DispatchClass::Operational, |weights| { - weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT); - // Operational transactions have some extra reserved space, so that they - // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`. - weights.reserved = Some( - MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT - ); - }) - .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) - .build_or_panic(); - pub const SS58Prefix: u8 = 42; -} - -#[derive_impl(frame_system::config_preludes::TestDefaultConfig)] -impl frame_system::Config for Runtime { - /// The identifier used to distinguish between accounts. - type AccountId = AccountId; - /// The aggregated dispatch type that is available for extrinsics. - type RuntimeCall = RuntimeCall; - /// The lookup mechanism to get account ID from whatever is passed in dispatchers. - type Lookup = AccountIdLookup; - /// The index type for storing how many extrinsics an account has signed. - type Nonce = Nonce; - /// The type for hashing blocks and tries. - type Hash = Hash; - /// The hashing algorithm used. - type Hashing = BlakeTwo256; - /// The block type. - type Block = Block; - /// The ubiquitous event type. - type RuntimeEvent = RuntimeEvent; - /// The ubiquitous origin type. - type RuntimeOrigin = RuntimeOrigin; - /// Maximum number of block number to block hash mappings to keep (oldest pruned first). - type BlockHashCount = BlockHashCount; - /// Runtime version. - type Version = Version; - /// Converts a module to an index of this module in the runtime. - type PalletInfo = PalletInfo; - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); - type OnKilledAccount = (); - type DbWeight = RocksDbWeight; - type BaseCallFilter = frame_support::traits::Everything; - type SystemWeightInfo = (); - type BlockWeights = RuntimeBlockWeights; - type BlockLength = RuntimeBlockLength; - type SS58Prefix = SS58Prefix; - type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; - type MaxConsumers = frame_support::traits::ConstU32<16>; - type SingleBlockMigrations = RemoveCollectiveFlip; -} - -impl cumulus_pallet_weight_reclaim::Config for Runtime { - type WeightInfo = (); -} - -impl pallet_timestamp::Config for Runtime { - /// A timestamp: milliseconds since the unix epoch. - type Moment = u64; - type OnTimestampSet = Aura; - type MinimumPeriod = ConstU64<0>; - type WeightInfo = (); -} - -parameter_types! { - pub const ExistentialDeposit: u128 = MILLIROC; - pub const TransferFee: u128 = MILLIROC; - pub const CreationFee: u128 = MILLIROC; - pub const TransactionByteFee: u128 = MICROROC; -} - -impl pallet_balances::Config for Runtime { - /// The type for recording an account's balance. - type Balance = Balance; - type DustRemoval = (); - /// The ubiquitous event type. - type RuntimeEvent = RuntimeEvent; - type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = (); - type MaxLocks = ConstU32<50>; - type MaxReserves = ConstU32<50>; - type ReserveIdentifier = [u8; 8]; - type RuntimeHoldReason = RuntimeHoldReason; - type RuntimeFreezeReason = RuntimeFreezeReason; - type FreezeIdentifier = (); - type MaxFreezes = ConstU32<0>; - type DoneSlashHandler = (); -} - -impl pallet_transaction_payment::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type OnChargeTransaction = pallet_transaction_payment::FungibleAdapter; - type WeightToFee = IdentityFee; - type LengthToFee = ConstantMultiplier; - type FeeMultiplierUpdate = (); - type OperationalFeeMultiplier = ConstU8<5>; - type WeightInfo = (); -} - -impl pallet_sudo::Config for Runtime { - type RuntimeCall = RuntimeCall; - type RuntimeEvent = RuntimeEvent; - type WeightInfo = pallet_sudo::weights::SubstrateWeight; -} - -parameter_types! { - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); - pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; -} - -type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< - Runtime, - RELAY_CHAIN_SLOT_DURATION_MILLIS, - BLOCK_PROCESSING_VELOCITY, - UNINCLUDED_SEGMENT_CAPACITY, ->; - -impl cumulus_pallet_parachain_system::Config for Runtime { - type WeightInfo = (); - type RuntimeEvent = RuntimeEvent; - type OnSystemEvent = (); - type SelfParaId = parachain_info::Pallet; - type OutboundXcmpMessageSource = XcmpQueue; - type DmpQueue = frame_support::traits::EnqueueWithOrigin; - type ReservedDmpWeight = ReservedDmpWeight; - type XcmpMessageHandler = XcmpQueue; - type ReservedXcmpWeight = ReservedXcmpWeight; - type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases; - type ConsensusHook = ConsensusHook; - type RelayParentOffset = ConstU32<0>; -} - -impl parachain_info::Config for Runtime {} - -parameter_types! { - pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; -} - -impl pallet_message_queue::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = (); - type MessageProcessor = xcm_builder::ProcessXcmMessage< - AggregateMessageOrigin, - xcm_executor::XcmExecutor, - RuntimeCall, - >; - type Size = u32; - // The XCMP queue pallet is only ever able to handle the `Sibling(ParaId)` origin: - type QueueChangeHandler = NarrowOriginToSibling; - type QueuePausedQuery = NarrowOriginToSibling; - type HeapSize = sp_core::ConstU32<{ 103 * 1024 }>; - type MaxStale = sp_core::ConstU32<8>; - type ServiceWeight = MessageQueueServiceWeight; - type IdleMaxServiceWeight = (); -} - -impl cumulus_pallet_aura_ext::Config for Runtime {} - -parameter_types! { - pub const RocLocation: Location = Location::parent(); - pub const RococoNetwork: NetworkId = NetworkId::ByGenesis(ROCOCO_GENESIS_HASH); - pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); - pub UniversalLocation: InteriorLocation = [GlobalConsensus(RococoNetwork::get()), Parachain(ParachainInfo::parachain_id().into())].into(); - pub CheckingAccount: AccountId = PolkadotXcm::check_account(); -} - -/// Type for specifying how a `Location` can be converted into an `AccountId`. This is used -/// when determining ownership of accounts for asset transacting and when attempting to use XCM -/// `Transact` in order to determine the dispatch Origin. -pub type LocationToAccountId = ( - // The parent (Relay-chain) origin converts to the parent `AccountId`. - ParentIsPreset, - // Sibling parachain origins convert to AccountId via the `ParaId::into`. - SiblingParachainConvertsVia, - // Straight up local `AccountId32` origins just alias directly to `AccountId`. - AccountId32Aliases, -); - -/// Means for transacting assets on this chain. -pub type FungibleTransactor = FungibleAdapter< - // Use this currency: - Balances, - // Use this currency when it is a fungible asset matching the given location or name: - IsConcrete, - // Do a simple punn to convert an AccountId32 Location into a native chain account ID: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We don't track any teleports. - (), ->; - -/// Means for transacting assets besides the native currency on this chain. -pub type FungiblesTransactor = FungiblesAdapter< - // Use this fungibles implementation: - Assets, - // Use this currency when it is a fungible asset matching the given location or name: - ConvertedConcreteId< - AssetIdForTrustBackedAssets, - u64, - AsPrefixedGeneralIndex< - SystemAssetHubAssetsPalletLocation, - AssetIdForTrustBackedAssets, - JustTry, - >, - JustTry, - >, - // Convert an XCM Location into a local account id: - LocationToAccountId, - // Our chain's account ID type (we can't get away without mentioning it explicitly): - AccountId, - // We only want to allow teleports of known assets. We use non-zero issuance as an indication - // that this asset is known. - LocalMint>, - // The account to use for tracking teleports. - CheckingAccount, ->; -/// Means for transacting assets on this chain. -pub type AssetTransactors = (FungibleTransactor, FungiblesTransactor); - -/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance, -/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can -/// biases the kind of local `Origin` it will become. -pub type XcmOriginToTransactDispatchOrigin = ( - // Sovereign account converter; this attempts to derive an `AccountId` from the origin location - // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for - // foreign chains who want to have a local sovereign account on this chain which they control. - SovereignSignedViaLocation, - // Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when - // recognised. - RelayChainAsNative, - // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when - // recognised. - SiblingParachainAsNative, - // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a - // transaction from the Root origin. - ParentAsSuperuser, - // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `RuntimeOrigin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, - // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, -); - -parameter_types! { - // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = Weight::from_parts(1_000_000_000, 64 * 1024); - // One ROC buys 1 second of weight. - pub const WeightPrice: (Location, u128) = (Location::parent(), ROC); - pub const MaxInstructions: u32 = 100; -} - -pub struct ParentOrParentsUnitPlurality; -impl Contains for ParentOrParentsUnitPlurality { - fn contains(location: &Location) -> bool { - matches!(location.unpack(), (1, []) | (1, [Plurality { id: BodyId::Unit, .. }])) - } -} - -pub struct AssetHub; -impl Contains for AssetHub { - fn contains(location: &Location) -> bool { - matches!(location.unpack(), (1, [Parachain(1000)])) - } -} - -pub type Barrier = TrailingSetTopicAsId<( - TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, - // Parent & its unit plurality gets free execution. - AllowExplicitUnpaidExecutionFrom, - // The network's Asset Hub gets free execution. - AllowExplicitUnpaidExecutionFrom, - // Expected responses are OK. - AllowKnownQueryResponses, - // Subscriptions for version tracking are OK. - AllowSubscriptionsFrom, - // HRMP notifications from the relay chain are OK. - AllowHrmpNotificationsFromRelayChain, -)>; - -parameter_types! { - pub MaxAssetsIntoHolding: u32 = 64; - pub SystemAssetHubLocation: Location = Location::new(1, [Parachain(1000)]); - // ALWAYS ensure that the index in PalletInstance stays up-to-date with - // the Relay Chain's Asset Hub's Assets pallet index - pub SystemAssetHubAssetsPalletLocation: Location = - Location::new(1, [Parachain(1000), PalletInstance(50)]); -} - -pub type Reserves = (NativeAsset, AssetsFrom); - -pub struct XcmConfig; -impl xcm_executor::Config for XcmConfig { - type RuntimeCall = RuntimeCall; - type XcmSender = XcmRouter; - type XcmEventEmitter = PolkadotXcm; - // How to withdraw and deposit an asset. - type AssetTransactor = AssetTransactors; - type OriginConverter = XcmOriginToTransactDispatchOrigin; - type IsReserve = Reserves; - type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of ROC - type UniversalLocation = UniversalLocation; - type Barrier = Barrier; - type Weigher = FixedWeightBounds; - type Trader = UsingComponents, RocLocation, AccountId, Balances, ()>; - type ResponseHandler = PolkadotXcm; - type AssetTrap = PolkadotXcm; - type AssetClaims = PolkadotXcm; - type SubscriptionService = PolkadotXcm; - type PalletInstancesInfo = AllPalletsWithSystem; - type MaxAssetsIntoHolding = MaxAssetsIntoHolding; - type AssetLocker = (); - type AssetExchanger = (); - type FeeManager = (); - type MessageExporter = (); - type UniversalAliases = Nothing; - type CallDispatcher = RuntimeCall; - type SafeCallFilter = Everything; - type Aliasers = Nothing; - type TransactionalProcessor = FrameTransactionalProcessor; - type HrmpNewChannelOpenRequestHandler = (); - type HrmpChannelAcceptedHandler = (); - type HrmpChannelClosingHandler = (); - type XcmRecorder = PolkadotXcm; -} - -/// Converts a local signed origin into an XCM location. Forms the basis for local origins -/// sending/executing XCMs. -pub type LocalOriginToLocation = SignedToAccountId32; - -/// The means for routing XCM messages which are not for local execution into the right message -/// queues. -pub type XcmRouter = WithUniqueTopic<( - // Two routers - use UMP to communicate with the relay chain: - cumulus_primitives_utility::ParentAsUmp, - // ..and XCMP to communicate with the sibling chains. - XcmpQueue, -)>; - -impl pallet_xcm::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type SendXcmOrigin = EnsureXcmOrigin; - type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; - type XcmExecuteFilter = Everything; - type XcmExecutor = XcmExecutor; - type XcmTeleportFilter = Everything; - type XcmReserveTransferFilter = Nothing; - type Weigher = FixedWeightBounds; - type UniversalLocation = UniversalLocation; - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; - type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; - type Currency = Balances; - type CurrencyMatcher = (); - type TrustedLockers = (); - type SovereignAccountOf = LocationToAccountId; - type MaxLockers = ConstU32<8>; - type WeightInfo = pallet_xcm::TestWeightInfo; - type AdminOrigin = EnsureRoot; - type MaxRemoteLockConsumers = ConstU32<0>; - type RemoteLockConsumerIdentifier = (); - // Aliasing is disabled: xcm_executor::Config::Aliasers is set to `Nothing`. - type AuthorizedAliasConsideration = Disabled; -} - -impl cumulus_pallet_xcm::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type XcmExecutor = XcmExecutor; -} - -impl cumulus_pallet_xcmp_queue::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type ChannelInfo = ParachainSystem; - type VersionWrapper = (); - // Enqueue XCMP messages from siblings for later processing. - type XcmpQueue = TransformOrigin; - type MaxInboundSuspended = ConstU32<1_000>; - type MaxActiveOutboundChannels = ConstU32<128>; - // Most on-chain HRMP channels are configured to use 102400 bytes of max message size, so we - // need to set the page size larger than that until we reduce the channel size on-chain. - type MaxPageSize = ConstU32<{ 103 * 1024 }>; - type ControllerOrigin = EnsureRoot; - type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; - type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight; - type PriceForSiblingDelivery = NoPriceForMessageDelivery; -} - -impl cumulus_ping::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type XcmSender = XcmRouter; -} - -parameter_types! { - pub const AssetDeposit: Balance = ROC; - pub const AssetAccountDeposit: Balance = ROC; - pub const ApprovalDeposit: Balance = 100 * MILLIROC; - pub const AssetsStringLimit: u32 = 50; - pub const MetadataDepositBase: Balance = ROC; - pub const MetadataDepositPerByte: Balance = 10 * MILLIROC; - pub const UnitBody: BodyId = BodyId::Unit; -} - -/// A majority of the Unit body from Rococo over XCM is our required administration origin. -pub type AdminOrigin = - EitherOfDiverse, EnsureXcm>>; - -impl pallet_assets::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type Balance = u64; - type AssetId = AssetIdForTrustBackedAssets; - type AssetIdParameter = codec::Compact; - type ReserveData = (); - type Currency = Balances; - type CreateOrigin = AsEnsureOriginWithArg>; - type ForceOrigin = AdminOrigin; - type AssetDeposit = AssetDeposit; - type MetadataDepositBase = MetadataDepositBase; - type MetadataDepositPerByte = MetadataDepositPerByte; - type ApprovalDeposit = ApprovalDeposit; - type StringLimit = AssetsStringLimit; - type Holder = (); - type Freezer = (); - type Extra = (); - type WeightInfo = pallet_assets::weights::SubstrateWeight; - type CallbackHandle = (); - type AssetAccountDeposit = AssetAccountDeposit; - type RemoveItemsLimit = frame_support::traits::ConstU32<1000>; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkHelper = (); -} - -impl pallet_aura::Config for Runtime { - type AuthorityId = AuraId; - type DisabledValidators = (); - type MaxAuthorities = ConstU32<100_000>; - type AllowMultipleBlocksPerSlot = ConstBool; - type SlotDuration = ConstU64; -} - -construct_runtime! { - pub enum Runtime - { - System: frame_system, - Timestamp: pallet_timestamp, - Sudo: pallet_sudo, - TransactionPayment: pallet_transaction_payment, - WeightReclaim: cumulus_pallet_weight_reclaim, - - ParachainSystem: cumulus_pallet_parachain_system = 20, - ParachainInfo: parachain_info = 21, - - Balances: pallet_balances = 30, - Assets: pallet_assets = 31, - - Aura: pallet_aura, - AuraExt: cumulus_pallet_aura_ext, - - // XCM helpers. - XcmpQueue: cumulus_pallet_xcmp_queue = 50, - PolkadotXcm: pallet_xcm = 51, - CumulusXcm: cumulus_pallet_xcm = 52, - // RIP DmpQueue 53 - MessageQueue: pallet_message_queue = 54, - - Spambot: cumulus_ping = 99, - } -} - -/// Balance of an account. -pub type Balance = u128; -/// Index of a transaction in the chain. -pub type Nonce = u32; -/// A hash of some data used by the chain. -pub type Hash = ::Output; -/// An index to a block. -pub type BlockNumber = u32; -/// The address format for describing accounts. -pub type Address = sp_runtime::MultiAddress; -/// Block header type as expected by this runtime. -pub type Header = generic::Header; -/// Block type as expected by this runtime. -pub type Block = generic::Block; -/// A Block signed with a Justification -pub type SignedBlock = generic::SignedBlock; -/// BlockId type as expected by this runtime. -pub type BlockId = generic::BlockId; -/// The extension to the basic transaction logic. -pub type TxExtension = cumulus_pallet_weight_reclaim::StorageWeightReclaim< - Runtime, - ( - frame_system::AuthorizeCall, - frame_system::CheckNonZeroSender, - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_transaction_payment::ChargeTransactionPayment, - ), ->; - -/// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = - generic::UncheckedExtrinsic; -/// Executive: handles dispatch to the various modules. -pub type Executive = frame_executive::Executive< - Runtime, - Block, - frame_system::ChainContext, - Runtime, - AllPalletsWithSystem, ->; - -pub struct RemoveCollectiveFlip; -impl frame_support::traits::OnRuntimeUpgrade for RemoveCollectiveFlip { - fn on_runtime_upgrade() -> Weight { - use frame_support::storage::migration; - // Remove the storage value `RandomMaterial` from removed pallet `RandomnessCollectiveFlip` - #[allow(deprecated)] - migration::remove_storage_prefix(b"RandomnessCollectiveFlip", b"RandomMaterial", b""); - ::DbWeight::get().writes(1) - } -} - -impl_runtime_apis! { - impl sp_api::Core for Runtime { - fn version() -> RuntimeVersion { - VERSION - } - - fn execute_block(block: ::LazyBlock) { - Executive::execute_block(block); - } - - fn initialize_block(header: &::Header) -> sp_runtime::ExtrinsicInclusionMode { - Executive::initialize_block(header) - } - } - - impl sp_api::Metadata for Runtime { - fn metadata() -> OpaqueMetadata { - OpaqueMetadata::new(Runtime::metadata().into()) - } - - fn metadata_at_version(version: u32) -> Option { - Runtime::metadata_at_version(version) - } - - fn metadata_versions() -> alloc::vec::Vec { - Runtime::metadata_versions() - } - } - - impl sp_block_builder::BlockBuilder for Runtime { - fn apply_extrinsic( - extrinsic: ::Extrinsic, - ) -> ApplyExtrinsicResult { - Executive::apply_extrinsic(extrinsic) - } - - fn finalize_block() -> ::Header { - Executive::finalize_block() - } - - fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<::Extrinsic> { - data.create_extrinsics() - } - - fn check_inherents(block: ::LazyBlock, data: sp_inherents::InherentData) -> sp_inherents::CheckInherentsResult { - data.check_extrinsics(&block) - } - } - - impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { - fn validate_transaction( - source: TransactionSource, - tx: ::Extrinsic, - block_hash: ::Hash, - ) -> TransactionValidity { - Executive::validate_transaction(source, tx, block_hash) - } - } - - impl sp_offchain::OffchainWorkerApi for Runtime { - fn offchain_worker(header: &::Header) { - Executive::offchain_worker(header) - } - } - - impl sp_session::SessionKeys for Runtime { - fn decode_session_keys( - encoded: Vec, - ) -> Option, sp_core::crypto::KeyTypeId)>> { - SessionKeys::decode_into_raw_public_keys(&encoded) - } - - fn generate_session_keys(seed: Option>) -> Vec { - SessionKeys::generate(seed) - } - } - - impl sp_consensus_aura::AuraApi for Runtime { - fn slot_duration() -> sp_consensus_aura::SlotDuration { - sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration()) - } - - fn authorities() -> Vec { - pallet_aura::Authorities::::get().into_inner() - } - } - - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Nonce { - System::account_nonce(account) - } - } - - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi for Runtime { - fn query_info( - uxt: ::Extrinsic, - len: u32, - ) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo { - TransactionPayment::query_info(uxt, len) - } - fn query_fee_details( - uxt: ::Extrinsic, - len: u32, - ) -> pallet_transaction_payment::FeeDetails { - TransactionPayment::query_fee_details(uxt, len) - } - fn query_weight_to_fee(weight: Weight) -> Balance { - TransactionPayment::weight_to_fee(weight) - } - fn query_length_to_fee(length: u32) -> Balance { - TransactionPayment::length_to_fee(length) - } - } - - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi - for Runtime - { - fn query_call_info( - call: RuntimeCall, - len: u32, - ) -> pallet_transaction_payment::RuntimeDispatchInfo { - TransactionPayment::query_call_info(call, len) - } - fn query_call_fee_details( - call: RuntimeCall, - len: u32, - ) -> pallet_transaction_payment::FeeDetails { - TransactionPayment::query_call_fee_details(call, len) - } - fn query_weight_to_fee(weight: Weight) -> Balance { - TransactionPayment::weight_to_fee(weight) - } - fn query_length_to_fee(length: u32) -> Balance { - TransactionPayment::length_to_fee(length) - } - } - - impl cumulus_primitives_core::CollectCollationInfo for Runtime { - fn collect_collation_info(header: &::Header) -> cumulus_primitives_core::CollationInfo { - ParachainSystem::collect_collation_info(header) - } - } - - impl sp_genesis_builder::GenesisBuilder for Runtime { - fn build_state(config: Vec) -> sp_genesis_builder::Result { - build_state::(config) - } - - fn get_preset(id: &Option) -> Option> { - get_preset::(id, &genesis_config_presets::get_preset) - } - - fn preset_names() -> Vec { - genesis_config_presets::preset_names() - } - } - - impl cumulus_primitives_core::RelayParentOffsetApi for Runtime { - fn relay_parent_offset() -> u32 { - 0 - } - } - - impl cumulus_primitives_aura::AuraUnincludedSegmentApi for Runtime { - fn can_build_upon( - included_hash: ::Hash, - slot: cumulus_primitives_aura::Slot, - ) -> bool { - ConsensusHook::can_build_upon(included_hash, slot) - } - } - - impl cumulus_primitives_core::GetParachainInfo for Runtime { - fn parachain_id() -> ParaId { - ParachainInfo::parachain_id() - } - } -} - -cumulus_pallet_parachain_system::register_validate_block! { - Runtime = Runtime, - BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, -} diff --git a/cumulus/polkadot-parachain/Cargo.toml b/cumulus/polkadot-parachain/Cargo.toml index 668e9748b7aeb..e0e4ac573c9a7 100644 --- a/cumulus/polkadot-parachain/Cargo.toml +++ b/cumulus/polkadot-parachain/Cargo.toml @@ -29,18 +29,15 @@ asset-hub-westend-runtime = { workspace = true, default-features = true } bridge-hub-rococo-runtime = { workspace = true, default-features = true } bridge-hub-westend-runtime = { workspace = true, default-features = true } collectives-westend-runtime = { workspace = true } -coretime-rococo-runtime = { workspace = true } coretime-westend-runtime = { workspace = true } glutton-westend-runtime = { workspace = true } parachains-common = { workspace = true, default-features = true } penpal-runtime = { workspace = true } -people-rococo-runtime = { workspace = true } people-westend-runtime = { workspace = true } polkadot-omni-node-lib = { features = [ "rococo-native", "westend-native", ], workspace = true } -rococo-parachain-runtime = { workspace = true } # Substrate sc-chain-spec = { workspace = true, default-features = true } @@ -77,13 +74,10 @@ runtime-benchmarks = [ "bridge-hub-rococo-runtime/runtime-benchmarks", "bridge-hub-westend-runtime/runtime-benchmarks", "collectives-westend-runtime/runtime-benchmarks", - "coretime-rococo-runtime/runtime-benchmarks", "coretime-westend-runtime/runtime-benchmarks", "glutton-westend-runtime/runtime-benchmarks", "penpal-runtime/runtime-benchmarks", - "people-rococo-runtime/runtime-benchmarks", "people-westend-runtime/runtime-benchmarks", - "rococo-parachain-runtime/runtime-benchmarks", "xcm/runtime-benchmarks", "yet-another-parachain-runtime/runtime-benchmarks", ] @@ -95,17 +89,14 @@ try-runtime = [ "bridge-hub-rococo-runtime/try-runtime", "bridge-hub-westend-runtime/try-runtime", "collectives-westend-runtime/try-runtime", - "coretime-rococo-runtime/try-runtime", "coretime-westend-runtime/try-runtime", "glutton-westend-runtime/try-runtime", "parachains-common/try-runtime", "penpal-runtime/try-runtime", - "people-rococo-runtime/try-runtime", "people-westend-runtime/try-runtime", ] fast-runtime = [ "bridge-hub-rococo-runtime/fast-runtime", "bridge-hub-westend-runtime/fast-runtime", - "coretime-rococo-runtime/fast-runtime", "coretime-westend-runtime/fast-runtime", ] diff --git a/cumulus/polkadot-parachain/src/chain_spec/coretime.rs b/cumulus/polkadot-parachain/src/chain_spec/coretime.rs index 5fff267995d1b..22debffa67e01 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/coretime.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/coretime.rs @@ -27,13 +27,6 @@ pub enum CoretimeRuntimeType { Polkadot, PolkadotLocal, - // Live - Rococo, - // Local - RococoLocal, - // Benchmarks - RococoDevelopment, - // Live Westend, // Local @@ -51,9 +44,6 @@ impl FromStr for CoretimeRuntimeType { kusama::CORETIME_KUSAMA_LOCAL => Ok(CoretimeRuntimeType::KusamaLocal), polkadot::CORETIME_POLKADOT => Ok(CoretimeRuntimeType::Polkadot), polkadot::CORETIME_POLKADOT_LOCAL => Ok(CoretimeRuntimeType::PolkadotLocal), - rococo::CORETIME_ROCOCO => Ok(CoretimeRuntimeType::Rococo), - rococo::CORETIME_ROCOCO_LOCAL => Ok(CoretimeRuntimeType::RococoLocal), - rococo::CORETIME_ROCOCO_DEVELOPMENT => Ok(CoretimeRuntimeType::RococoDevelopment), westend::CORETIME_WESTEND => Ok(CoretimeRuntimeType::Westend), westend::CORETIME_WESTEND_LOCAL => Ok(CoretimeRuntimeType::WestendLocal), westend::CORETIME_WESTEND_DEVELOPMENT => Ok(CoretimeRuntimeType::WestendDevelopment), @@ -69,9 +59,6 @@ impl From for &str { CoretimeRuntimeType::KusamaLocal => kusama::CORETIME_KUSAMA_LOCAL, CoretimeRuntimeType::Polkadot => polkadot::CORETIME_POLKADOT, CoretimeRuntimeType::PolkadotLocal => polkadot::CORETIME_POLKADOT_LOCAL, - CoretimeRuntimeType::Rococo => rococo::CORETIME_ROCOCO, - CoretimeRuntimeType::RococoLocal => rococo::CORETIME_ROCOCO_LOCAL, - CoretimeRuntimeType::RococoDevelopment => rococo::CORETIME_ROCOCO_DEVELOPMENT, CoretimeRuntimeType::Westend => westend::CORETIME_WESTEND, CoretimeRuntimeType::WestendLocal => westend::CORETIME_WESTEND_LOCAL, CoretimeRuntimeType::WestendDevelopment => westend::CORETIME_WESTEND_DEVELOPMENT, @@ -84,14 +71,11 @@ impl From for ChainType { match runtime_type { CoretimeRuntimeType::Kusama | CoretimeRuntimeType::Polkadot | - CoretimeRuntimeType::Rococo | CoretimeRuntimeType::Westend => ChainType::Live, CoretimeRuntimeType::KusamaLocal | CoretimeRuntimeType::PolkadotLocal | - CoretimeRuntimeType::RococoLocal | CoretimeRuntimeType::WestendLocal => ChainType::Local, - CoretimeRuntimeType::RococoDevelopment | CoretimeRuntimeType::WestendDevelopment => - ChainType::Development, + CoretimeRuntimeType::WestendDevelopment => ChainType::Development, } } } @@ -107,13 +91,6 @@ impl CoretimeRuntimeType { CoretimeRuntimeType::Polkadot => Ok(Box::new(GenericChainSpec::from_json_bytes( &include_bytes!("../../chain-specs/coretime-polkadot.json")[..], )?)), - CoretimeRuntimeType::Rococo => Ok(Box::new(GenericChainSpec::from_json_bytes( - &include_bytes!("../../chain-specs/coretime-rococo.json")[..], - )?)), - CoretimeRuntimeType::RococoLocal => - Ok(Box::new(rococo::local_config(*self, "rococo-local"))), - CoretimeRuntimeType::RococoDevelopment => - Ok(Box::new(rococo::local_config(*self, "rococo-dev"))), CoretimeRuntimeType::Westend => Ok(Box::new(GenericChainSpec::from_json_bytes( &include_bytes!("../../../parachains/chain-specs/coretime-westend.json")[..], )?)), @@ -140,51 +117,6 @@ pub fn chain_type_name(chain_type: &ChainType) -> Cow<'_, str> { .into() } -/// Sub-module for Rococo setup. -pub mod rococo { - use super::{chain_type_name, CoretimeRuntimeType}; - use polkadot_omni_node_lib::chain_spec::{Extensions, GenericChainSpec}; - use sc_chain_spec::ChainType; - - pub(crate) const CORETIME_ROCOCO: &str = "coretime-rococo"; - pub(crate) const CORETIME_ROCOCO_LOCAL: &str = "coretime-rococo-local"; - pub(crate) const CORETIME_ROCOCO_DEVELOPMENT: &str = "coretime-rococo-dev"; - - pub fn local_config(runtime_type: CoretimeRuntimeType, relay_chain: &str) -> GenericChainSpec { - // Rococo defaults - let mut properties = sc_chain_spec::Properties::new(); - properties.insert("ss58Format".into(), 42.into()); - properties.insert("tokenSymbol".into(), "ROC".into()); - properties.insert("tokenDecimals".into(), 12.into()); - - let chain_type = runtime_type.into(); - let chain_name = format!("Coretime Rococo {}", chain_type_name(&chain_type)); - - let wasm_binary = if matches!(chain_type, ChainType::Local | ChainType::Development) { - coretime_rococo_runtime::fast_runtime_binary::WASM_BINARY - .expect("WASM binary was not built, please build it!") - } else { - coretime_rococo_runtime::WASM_BINARY - .expect("WASM binary was not built, please build it!") - }; - - GenericChainSpec::builder( - wasm_binary, - Extensions::new_with_relay_chain(relay_chain.to_string()), - ) - .with_name(&chain_name) - .with_id(runtime_type.into()) - .with_chain_type(chain_type.clone()) - .with_genesis_config_preset_name(match chain_type { - ChainType::Development => sp_genesis_builder::DEV_RUNTIME_PRESET, - ChainType::Local => sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET, - _ => panic!("chain_type: {chain_type:?} not supported here!"), - }) - .with_properties(properties) - .build() - } -} - /// Sub-module for Westend setup. pub mod westend { use super::{chain_type_name, CoretimeRuntimeType, GenericChainSpec}; diff --git a/cumulus/polkadot-parachain/src/chain_spec/mod.rs b/cumulus/polkadot-parachain/src/chain_spec/mod.rs index cfcafbfa57783..c996fab184887 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/mod.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/mod.rs @@ -31,7 +31,6 @@ pub mod coretime; pub mod glutton; pub mod penpal; pub mod people; -pub mod rococo_parachain; pub mod yet_another_parachain; /// Extracts the normalized chain id and parachain id from the input chain id. @@ -58,7 +57,7 @@ impl LoadSpec for ChainSpecLoader { fn load_spec(&self, id: &str) -> Result, String> { Ok(match id { // - Default-like - "staging" => Box::new(rococo_parachain::staging_rococo_parachain_local_config()), + "staging" => Box::new(penpal::staging_penpal_local_config()), "tick" => Box::new(GenericChainSpec::from_json_bytes( &include_bytes!("../../chain-specs/tick.json")[..], )?), @@ -202,8 +201,10 @@ impl LoadSpec for ChainSpecLoader { // -- Fallback (generic chainspec) "" => { - log::warn!("No ChainSpec.id specified, so using default one, based on rococo-parachain runtime"); - Box::new(rococo_parachain::rococo_parachain_local_config()) + log::warn!( + "No ChainSpec.id specified, so using default one, based on Penpal runtime" + ); + Box::new(penpal::staging_penpal_local_config()) }, // -- Loading a specific spec from disk @@ -322,8 +323,7 @@ mod tests { extension: E, ) -> DummyChainSpec { DummyChainSpec::builder( - rococo_parachain_runtime::WASM_BINARY - .expect("WASM binary was not built, please build it!"), + penpal_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), extension, ) .with_name("Dummy local testnet") @@ -338,8 +338,5 @@ mod tests { let chain_spec = create_default_with_extensions("penpal-rococo-1000", Extensions2::default()); assert_eq!(LegacyRuntime::Penpal, LegacyRuntime::from_id(chain_spec.id())); - - let chain_spec = crate::chain_spec::rococo_parachain::rococo_parachain_local_config(); - assert_eq!(LegacyRuntime::Omni, LegacyRuntime::from_id(chain_spec.id())); } } diff --git a/cumulus/polkadot-parachain/src/chain_spec/penpal.rs b/cumulus/polkadot-parachain/src/chain_spec/penpal.rs index 2d9cda5b68f42..750e2ff243fb5 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/penpal.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/penpal.rs @@ -15,8 +15,11 @@ // limitations under the License. use cumulus_primitives_core::ParaId; +use hex_literal::hex; +use parachains_common::{AccountId, AuraId}; use polkadot_omni_node_lib::chain_spec::{Extensions, GenericChainSpec}; use sc_service::ChainType; +use sp_core::crypto::UncheckedInto; pub fn get_penpal_chain_spec(id: ParaId, relay_chain: &str) -> GenericChainSpec { // Give your base currency a unit name and decimal places @@ -40,3 +43,46 @@ pub fn get_penpal_chain_spec(id: ParaId, relay_chain: &str) -> GenericChainSpec })) .build() } + +pub fn staging_penpal_local_config() -> GenericChainSpec { + GenericChainSpec::builder( + penpal_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), + Extensions::new_with_relay_chain("rococo-local".into()), + ) + .with_name("Staging Rococo Penpal Local") + .with_id("staging_testnet") + .with_chain_type(ChainType::Live) + .with_genesis_config_preset_name(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET) + .with_genesis_config_patch(testnet_genesis_patch( + hex!["9ed7705e3c7da027ba0583a22a3212042f7e715d3c168ba14f1424e2bc111d00"].into(), + vec![ + // $secret//one + hex!["aad9fa2249f87a210a0f93400b7f90e47b810c6d65caa0ca3f5af982904c2a33"] + .unchecked_into(), + // $secret//two + hex!["d47753f0cca9dd8da00c70e82ec4fc5501a69c49a5952a643d18802837c88212"] + .unchecked_into(), + ], + vec![hex!["9ed7705e3c7da027ba0583a22a3212042f7e715d3c168ba14f1424e2bc111d00"].into()], + 1000.into(), + )) + .build() +} + +pub(crate) fn testnet_genesis_patch( + root_key: AccountId, + initial_authorities: Vec, + endowed_accounts: Vec, + id: ParaId, +) -> serde_json::Value { + serde_json::json!({ + "balances": { + "balances": endowed_accounts.iter().cloned().map(|k| (k, 1u64 << 60)).collect::>(), + }, + "sudo": { "key": Some(root_key) }, + "parachainInfo": { + "parachainId": id, + }, + "aura": { "authorities": initial_authorities }, + }) +} diff --git a/cumulus/polkadot-parachain/src/chain_spec/people.rs b/cumulus/polkadot-parachain/src/chain_spec/people.rs index 6735a15973df9..306676832ebca 100644 --- a/cumulus/polkadot-parachain/src/chain_spec/people.rs +++ b/cumulus/polkadot-parachain/src/chain_spec/people.rs @@ -25,9 +25,6 @@ pub enum PeopleRuntimeType { KusamaLocal, Polkadot, PolkadotLocal, - Rococo, - RococoLocal, - RococoDevelopment, Westend, WestendLocal, WestendDevelopment, @@ -42,9 +39,6 @@ impl FromStr for PeopleRuntimeType { kusama::PEOPLE_KUSAMA_LOCAL => Ok(PeopleRuntimeType::KusamaLocal), polkadot::PEOPLE_POLKADOT => Ok(PeopleRuntimeType::Polkadot), polkadot::PEOPLE_POLKADOT_LOCAL => Ok(PeopleRuntimeType::PolkadotLocal), - rococo::PEOPLE_ROCOCO => Ok(PeopleRuntimeType::Rococo), - rococo::PEOPLE_ROCOCO_LOCAL => Ok(PeopleRuntimeType::RococoLocal), - rococo::PEOPLE_ROCOCO_DEVELOPMENT => Ok(PeopleRuntimeType::RococoDevelopment), westend::PEOPLE_WESTEND => Ok(PeopleRuntimeType::Westend), westend::PEOPLE_WESTEND_LOCAL => Ok(PeopleRuntimeType::WestendLocal), westend::PEOPLE_WESTEND_DEVELOPMENT => Ok(PeopleRuntimeType::WestendDevelopment), @@ -64,21 +58,6 @@ impl PeopleRuntimeType { PeopleRuntimeType::Polkadot => Ok(Box::new(GenericChainSpec::from_json_bytes( &include_bytes!("../../chain-specs/people-polkadot.json")[..], )?)), - PeopleRuntimeType::Rococo => Ok(Box::new(GenericChainSpec::from_json_bytes( - &include_bytes!("../../chain-specs/people-rococo.json")[..], - )?)), - PeopleRuntimeType::RococoLocal => Ok(Box::new(rococo::local_config( - rococo::PEOPLE_ROCOCO_LOCAL, - "Rococo People Local", - "rococo-local", - ChainType::Local, - ))), - PeopleRuntimeType::RococoDevelopment => Ok(Box::new(rococo::local_config( - rococo::PEOPLE_ROCOCO_DEVELOPMENT, - "Rococo People Development", - "rococo-development", - ChainType::Development, - ))), PeopleRuntimeType::Westend => Ok(Box::new(GenericChainSpec::from_json_bytes( &include_bytes!("../../chain-specs/people-westend.json")[..], )?)), @@ -115,44 +94,6 @@ fn ensure_id(id: &str) -> Result<&str, String> { } } -/// Sub-module for Rococo setup. -pub mod rococo { - use polkadot_omni_node_lib::chain_spec::{Extensions, GenericChainSpec}; - use sc_chain_spec::ChainType; - - pub(crate) const PEOPLE_ROCOCO: &str = "people-rococo"; - pub(crate) const PEOPLE_ROCOCO_LOCAL: &str = "people-rococo-local"; - pub(crate) const PEOPLE_ROCOCO_DEVELOPMENT: &str = "people-rococo-dev"; - - pub fn local_config( - spec_id: &str, - chain_name: &str, - relay_chain: &str, - chain_type: ChainType, - ) -> GenericChainSpec { - let mut properties = sc_chain_spec::Properties::new(); - properties.insert("ss58Format".into(), 42.into()); - properties.insert("tokenSymbol".into(), "ROC".into()); - properties.insert("tokenDecimals".into(), 12.into()); - - GenericChainSpec::builder( - people_rococo_runtime::WASM_BINARY - .expect("WASM binary was not built, please build it!"), - Extensions::new_with_relay_chain(relay_chain.to_string()), - ) - .with_name(chain_name) - .with_id(super::ensure_id(spec_id).expect("invalid id")) - .with_chain_type(chain_type.clone()) - .with_genesis_config_preset_name(match chain_type { - ChainType::Development => sp_genesis_builder::DEV_RUNTIME_PRESET, - ChainType::Local => sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET, - _ => panic!("chain_type: {chain_type:?} not supported here!"), - }) - .with_properties(properties) - .build() - } -} - /// Sub-module for Westend setup. pub mod westend { use polkadot_omni_node_lib::chain_spec::{Extensions, GenericChainSpec}; diff --git a/cumulus/polkadot-parachain/src/chain_spec/rococo_parachain.rs b/cumulus/polkadot-parachain/src/chain_spec/rococo_parachain.rs deleted file mode 100644 index dc6a3b6666277..0000000000000 --- a/cumulus/polkadot-parachain/src/chain_spec/rococo_parachain.rs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (C) Parity Technologies (UK) Ltd. -// This file is part of Cumulus. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! ChainSpecs dedicated to Rococo parachain setups (for testing and example purposes) - -use cumulus_primitives_core::ParaId; -use hex_literal::hex; -use parachains_common::AccountId; -use polkadot_omni_node_lib::chain_spec::{Extensions, GenericChainSpec}; -use rococo_parachain_runtime::AuraId; -use sc_chain_spec::ChainType; -use sp_core::crypto::UncheckedInto; - -pub fn rococo_parachain_local_config() -> GenericChainSpec { - GenericChainSpec::builder( - rococo_parachain_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - Extensions::new_with_relay_chain("rococo-local".into()), - ) - .with_name("Rococo Parachain Local") - .with_id("local_testnet") - .with_chain_type(ChainType::Local) - .with_genesis_config_preset_name(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET) - .build() -} - -pub fn staging_rococo_parachain_local_config() -> GenericChainSpec { - GenericChainSpec::builder( - rococo_parachain_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - Extensions::new_with_relay_chain("rococo-local".into()), - ) - .with_name("Staging Rococo Parachain Local") - .with_id("staging_testnet") - .with_chain_type(ChainType::Live) - .with_genesis_config_preset_name(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET) - .with_genesis_config_patch(testnet_genesis_patch( - hex!["9ed7705e3c7da027ba0583a22a3212042f7e715d3c168ba14f1424e2bc111d00"].into(), - vec![ - // $secret//one - hex!["aad9fa2249f87a210a0f93400b7f90e47b810c6d65caa0ca3f5af982904c2a33"] - .unchecked_into(), - // $secret//two - hex!["d47753f0cca9dd8da00c70e82ec4fc5501a69c49a5952a643d18802837c88212"] - .unchecked_into(), - ], - vec![hex!["9ed7705e3c7da027ba0583a22a3212042f7e715d3c168ba14f1424e2bc111d00"].into()], - 1000.into(), - )) - .build() -} - -pub(crate) fn testnet_genesis_patch( - root_key: AccountId, - initial_authorities: Vec, - endowed_accounts: Vec, - id: ParaId, -) -> serde_json::Value { - serde_json::json!({ - "balances": { - "balances": endowed_accounts.iter().cloned().map(|k| (k, 1u64 << 60)).collect::>(), - }, - "sudo": { "key": Some(root_key) }, - "parachainInfo": { - "parachainId": id, - }, - "aura": { "authorities": initial_authorities }, - }) -} diff --git a/cumulus/scripts/create_coretime_rococo_spec.sh b/cumulus/scripts/create_coretime_rococo_spec.sh deleted file mode 100755 index 877e8ee36c7d9..0000000000000 --- a/cumulus/scripts/create_coretime_rococo_spec.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -usage() { - echo Usage: - echo "$1 " - echo "$2 " - echo "e.g.: ./cumulus/scripts/create_coretime_rococo_spec.sh ./target/release/wbuild/coretime-rococo-runtime/coretime_rococo_runtime.compact.compressed.wasm 1005" - exit 1 -} - -if [ -z "$1" ]; then - usage -fi - -if [ -z "$2" ]; then - usage -fi - -set -e - -rt_path=$1 -para_id=$2 - -echo "Generating chain spec for runtime: $rt_path and para_id: $para_id" - -binary="./target/release/polkadot-parachain" - -# build the chain spec we'll manipulate -$binary build-spec --chain coretime-rococo-dev > chain-spec-plain.json - -# convert runtime to hex -cat $rt_path | od -A n -v -t x1 | tr -d ' \n' > rt-hex.txt - -# replace the runtime in the spec with the given runtime and set some values to production -# Related issue for bootNodes, invulnerables, and session keys: https://github.com/paritytech/devops/issues/2725 -cat chain-spec-plain.json | jq --rawfile code rt-hex.txt '.genesis.runtimeGenesis.code = ("0x" + $code)' \ - | jq '.name = "Rococo Coretime"' \ - | jq '.id = "coretime-rococo"' \ - | jq '.chainType = "Live"' \ - | jq '.bootNodes = [ - "/dns/rococo-coretime-collator-node-0.polkadot.io/tcp/30333/p2p/12D3KooWHBUH9wGBx1Yq1ZePov9VL3AzxRPv5DTR4KadiCU6VKxy", - "/dns/rococo-coretime-collator-node-1.polkadot.io/tcp/30333/p2p/12D3KooWB3SKxdj6kpwTkdMnHJi6YmadojCzmEqFkeFJjxN812XX" - ]' \ - | jq '.relay_chain = "rococo"' \ - | jq --argjson para_id $para_id '.para_id = $para_id' \ - | jq --argjson para_id $para_id '.genesis.runtimeGenesis.patch.parachainInfo.parachainId = $para_id' \ - | jq '.genesis.runtimeGenesis.patch.balances.balances = []' \ - | jq '.genesis.runtimeGenesis.patch.collatorSelection.invulnerables = [ - "5G6Zua7Sowmt6ziddwUyueQs7HXDUVvDLaqqJDXXFyKvQ6Y6", - "5C8aSedh7ShpWEPW8aTNEErbKkMbiibdwP8cRzVRNqLmzAWF" - ]' \ - | jq '.genesis.runtimeGenesis.patch.session.keys = [ - [ - "5G6Zua7Sowmt6ziddwUyueQs7HXDUVvDLaqqJDXXFyKvQ6Y6", - "5G6Zua7Sowmt6ziddwUyueQs7HXDUVvDLaqqJDXXFyKvQ6Y6", - { - "aura": "5G6Zua7Sowmt6ziddwUyueQs7HXDUVvDLaqqJDXXFyKvQ6Y6" - } - ], - [ - "5C8aSedh7ShpWEPW8aTNEErbKkMbiibdwP8cRzVRNqLmzAWF", - "5C8aSedh7ShpWEPW8aTNEErbKkMbiibdwP8cRzVRNqLmzAWF", - { - "aura": "5C8aSedh7ShpWEPW8aTNEErbKkMbiibdwP8cRzVRNqLmzAWF" - } - ] - ]' \ - > edited-chain-spec-plain.json - -# build a raw spec -$binary build-spec --chain edited-chain-spec-plain.json --raw > chain-spec-raw.json -cp edited-chain-spec-plain.json coretime-rococo-spec.json -cp chain-spec-raw.json ./cumulus/parachains/chain-specs/coretime-rococo.json -cp chain-spec-raw.json coretime-rococo-spec-raw.json - -# build genesis data -$binary export-genesis-state --chain chain-spec-raw.json > coretime-rococo-genesis-head-data - -# build genesis wasm -$binary export-genesis-wasm --chain chain-spec-raw.json > coretime-rococo-wasm - -# cleanup -rm -f rt-hex.txt -rm -f chain-spec-plain.json -rm -f chain-spec-raw.json -rm -f edited-chain-spec-plain.json diff --git a/cumulus/scripts/create_people_rococo_spec.sh b/cumulus/scripts/create_people_rococo_spec.sh deleted file mode 100755 index 264408b20bce3..0000000000000 --- a/cumulus/scripts/create_people_rococo_spec.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env bash - -usage() { - echo Usage: - echo "$1 " - echo "$2 " - echo "e.g.: ./cumulus/scripts/create_people_rococo_spec.sh ./target/release/wbuild/people-rococo-runtime/people_rococo_runtime.compact.compressed.wasm 1004" - exit 1 -} - -if [ -z "$1" ]; then - usage -fi - -if [ -z "$2" ]; then - usage -fi - -set -e - -rt_path=$1 -para_id=$2 - -echo "Generating chain spec for runtime: $rt_path and para_id: $para_id" - -binary="./target/release/polkadot-parachain" - -# build the chain spec we'll manipulate -$binary build-spec --chain people-rococo-local > chain-spec-plain.json - -# convert runtime to hex -cat $rt_path | od -A n -v -t x1 | tr -d ' \n' > rt-hex.txt - -# replace the runtime in the spec with the given runtime and set some values to production -# Boot nodes, invulnerables, and session keys from https://github.com/paritytech/devops/issues/2847 -# -# Note: This is a testnet runtime. Each invulnerable's Aura key is also used as its AccountId. This -# is not recommended in value-bearing networks. -cat chain-spec-plain.json | jq --rawfile code rt-hex.txt '.genesis.runtimeGenesis.code = ("0x" + $code)' \ - | jq '.name = "Rococo People"' \ - | jq '.id = "people-rococo"' \ - | jq '.chainType = "Live"' \ - | jq '.bootNodes = [ - "/dns/rococo-people-collator-node-0.parity-testnet.parity.io/tcp/30333/p2p/12D3KooWDZg5jMYhKXTu6RU491V5sxsFnP4oaEmZJEUfcRkYzps5", - "/dns/rococo-people-collator-node-0.parity-testnet.parity.io/tcp/443/wss/p2p/12D3KooWDZg5jMYhKXTu6RU491V5sxsFnP4oaEmZJEUfcRkYzps5", - "/dns/rococo-people-collator-node-1.parity-testnet.parity.io/tcp/30333/p2p/12D3KooWGGR5i6qQqfo7iDNp7vjDRKPWuDk53idGV6nFLwS12X5H", - "/dns/rococo-people-collator-node-1.parity-testnet.parity.io/tcp/443/wss/p2p/12D3KooWGGR5i6qQqfo7iDNp7vjDRKPWuDk53idGV6nFLwS12X5H", - "/dns/rococo-people-collator-node-2.parity-testnet.parity.io/tcp/30333/p2p/12D3KooWBvA9BmBfrsVMcAcqVXGYFCpMTvkSk2igNXpmoareYbeT", - "/dns/rococo-people-collator-node-2.parity-testnet.parity.io/tcp/443/wss/p2p/12D3KooWBvA9BmBfrsVMcAcqVXGYFCpMTvkSk2igNXpmoareYbeT", - "/dns/rococo-people-collator-node-3.parity-testnet.parity.io/tcp/30333/p2p/12D3KooWQ7Q9jLcJTPXy7KEp5hSZ8YMY9pHx9CnQVz3T8TKQ81UG", - "/dns/rococo-people-collator-node-3.parity-testnet.parity.io/tcp/443/wss/p2p/12D3KooWQ7Q9jLcJTPXy7KEp5hSZ8YMY9pHx9CnQVz3T8TKQ81UG" - ]' \ - | jq '.relay_chain = "rococo"' \ - | jq --argjson para_id $para_id '.para_id = $para_id' \ - | jq --argjson para_id $para_id '.genesis.runtimeGenesis.patch.parachainInfo.parachainId = $para_id' \ - | jq '.genesis.runtimeGenesis.patch.balances.balances = []' \ - | jq '.genesis.runtimeGenesis.patch.collatorSelection.invulnerables = [ - "5Gnjmw1iuF2kV4PecFgetJed7B8quBKfLiRM99ELcXvFH9Vn", - "5FLZRxyeRPhG69zo4ZPqCJSYboSKaRBUjBvQc1nkuWoBpZ5P", - "5DNnmPH2MT6SXpfqbJZbTz4eERmuZegssfxc4ysL8PWrHaNN", - "5DkKcSP5MboNMpXScW1CyRqaktKMXH8QLP4Mn49TwS5vhL6k" - ]' \ - | jq '.genesis.runtimeGenesis.patch.session.keys = [ - [ - "5Gnjmw1iuF2kV4PecFgetJed7B8quBKfLiRM99ELcXvFH9Vn", - "5Gnjmw1iuF2kV4PecFgetJed7B8quBKfLiRM99ELcXvFH9Vn", - { - "aura": "5Gnjmw1iuF2kV4PecFgetJed7B8quBKfLiRM99ELcXvFH9Vn" - } - ], - [ - "5FLZRxyeRPhG69zo4ZPqCJSYboSKaRBUjBvQc1nkuWoBpZ5P", - "5FLZRxyeRPhG69zo4ZPqCJSYboSKaRBUjBvQc1nkuWoBpZ5P", - { - "aura": "5FLZRxyeRPhG69zo4ZPqCJSYboSKaRBUjBvQc1nkuWoBpZ5P" - } - ], - [ - "5DNnmPH2MT6SXpfqbJZbTz4eERmuZegssfxc4ysL8PWrHaNN", - "5DNnmPH2MT6SXpfqbJZbTz4eERmuZegssfxc4ysL8PWrHaNN", - { - "aura": "5DNnmPH2MT6SXpfqbJZbTz4eERmuZegssfxc4ysL8PWrHaNN" - } - ], - [ - "5DkKcSP5MboNMpXScW1CyRqaktKMXH8QLP4Mn49TwS5vhL6k", - "5DkKcSP5MboNMpXScW1CyRqaktKMXH8QLP4Mn49TwS5vhL6k", - { - "aura": "5DkKcSP5MboNMpXScW1CyRqaktKMXH8QLP4Mn49TwS5vhL6k" - } - ] - ]' \ - > edited-chain-spec-plain.json - -# build a raw spec -$binary build-spec --chain edited-chain-spec-plain.json --raw > chain-spec-raw.json -cp edited-chain-spec-plain.json people-rococo-spec.json -cp chain-spec-raw.json ./cumulus/parachains/chain-specs/people-rococo.json -cp chain-spec-raw.json people-rococo-spec-raw.json - -# build genesis data -$binary export-genesis-state --chain chain-spec-raw.json > people-rococo-genesis-head-data - -# build genesis wasm -$binary export-genesis-wasm --chain chain-spec-raw.json > people-rococo-wasm diff --git a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/statement_store_bench.rs b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/statement_store_bench.rs index a284344ec703a..91238836a69e2 100644 --- a/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/statement_store_bench.rs +++ b/cumulus/zombienet/zombienet-sdk/tests/zombie_ci/statement_store_bench.rs @@ -307,14 +307,14 @@ async fn statement_store_memory_stress_bench() -> Result<(), anyhow::Error> { Ok(()) } -/// Spawns a network using a custom chain spec (people-rococo-spec.json) which validates any signed +/// Spawns a network using a custom chain spec (people-westend-spec.json) which validates any signed /// statement in the statement-store without additional verification. async fn spawn_network(collators: &[&str]) -> Result, anyhow::Error> { assert!(collators.len() >= 2); let images = zombienet_sdk::environment::get_images_from_env(); let config = NetworkConfigBuilder::new() .with_relaychain(|r| { - r.with_chain("rococo-local") + r.with_chain("westend-local") .with_default_command("polkadot") .with_default_image(images.polkadot.as_str()) .with_default_args(vec!["-lparachain=debug".into()]) @@ -326,7 +326,7 @@ async fn spawn_network(collators: &[&str]) -> Result, a .with_id(2400) .with_default_command("polkadot-parachain") .with_default_image(images.cumulus.as_str()) - .with_chain_spec_path("tests/zombie_ci/people-rococo-spec.json") + .with_chain_spec_path("tests/zombie_ci/people-westend-spec.json") .with_default_args(vec![ "--force-authoring".into(), "-lstatement-store=info,statement-gossip=info,error".into(), diff --git a/polkadot/zombienet-sdk-tests/build.rs b/polkadot/zombienet-sdk-tests/build.rs index f1fd0360724c7..c66723e19df47 100644 --- a/polkadot/zombienet-sdk-tests/build.rs +++ b/polkadot/zombienet-sdk-tests/build.rs @@ -132,7 +132,7 @@ fn main() { // Ensure we have the needed metadata files in place to run zombienet tests let manifest_path = env::var("CARGO_MANIFEST_DIR").unwrap(); const METADATA_DIR: &str = "metadata-files"; - const CHAINS: [&str; 3] = ["rococo", "coretime-rococo", "asset-hub-westend"]; + const CHAINS: [&str; 3] = ["westend", "coretime-westend", "asset-hub-westend"]; let metadata_path = format!("{manifest_path}/{METADATA_DIR}"); diff --git a/polkadot/zombienet-sdk-tests/tests/elastic_scaling/doesnt_break_parachains.rs b/polkadot/zombienet-sdk-tests/tests/elastic_scaling/doesnt_break_parachains.rs index 3180822ab36b9..37969054602b8 100644 --- a/polkadot/zombienet-sdk-tests/tests/elastic_scaling/doesnt_break_parachains.rs +++ b/polkadot/zombienet-sdk-tests/tests/elastic_scaling/doesnt_break_parachains.rs @@ -47,8 +47,7 @@ async fn doesnt_break_parachains_test() -> Result<(), anyhow::Error> { (1..4).fold(r, |acc, i| acc.with_node(|node| node.with_name(&format!("validator-{i}")))) }) .with_parachain(|p| { - // Use rococo-parachain default, which has 6 second slot time. Also, don't use - // slot-based collator. + // Use default, which has 6 second slot time. Also, don't use slot-based collator. p.with_id(2000) .with_default_command("polkadot-parachain") .with_default_image(images.cumulus.as_str()) diff --git a/polkadot/zombienet-sdk-tests/tests/smoke/coretime_revenue.rs b/polkadot/zombienet-sdk-tests/tests/smoke/coretime_revenue.rs index 501b1b20a51eb..5782c193da916 100644 --- a/polkadot/zombienet-sdk-tests/tests/smoke/coretime_revenue.rs +++ b/polkadot/zombienet-sdk-tests/tests/smoke/coretime_revenue.rs @@ -11,13 +11,15 @@ use anyhow::anyhow; -#[zombienet_sdk::subxt::subxt(runtime_metadata_path = "metadata-files/coretime-rococo-local.scale")] -mod coretime_rococo {} +#[zombienet_sdk::subxt::subxt( + runtime_metadata_path = "metadata-files/coretime-westend-local.scale" +)] +mod coretime_westend {} -#[zombienet_sdk::subxt::subxt(runtime_metadata_path = "metadata-files/rococo-local.scale")] -mod rococo {} +#[zombienet_sdk::subxt::subxt(runtime_metadata_path = "metadata-files/westend-local.scale")] +mod westend {} -use rococo::runtime_types::{ +use westend::runtime_types::{ polkadot_parachain_primitives::primitives, staging_xcm::v4::{ asset::{Asset, AssetId, Assets, Fungibility}, @@ -37,7 +39,7 @@ use zombienet_sdk::{ NetworkConfigBuilder, }; -use coretime_rococo::{ +use coretime_westend::{ self as coretime_api, broker::events as broker_events, runtime_types::{ @@ -45,9 +47,9 @@ use coretime_rococo::{ sp_arithmetic::per_things::Perbill, }, }; -use rococo::on_demand_assignment_provider::events as on_demand_events; +use westend::on_demand_assignment_provider::events as on_demand_events; -type CoretimeRuntimeCall = coretime_api::runtime_types::coretime_rococo_runtime::RuntimeCall; +type CoretimeRuntimeCall = coretime_api::runtime_types::coretime_westend_runtime::RuntimeCall; type CoretimeUtilityCall = coretime_api::runtime_types::pallet_utility::pallet::Call; type CoretimeBrokerCall = coretime_api::runtime_types::pallet_broker::pallet::Call; @@ -64,7 +66,7 @@ async fn get_total_issuance( .at_latest() .await .unwrap() - .fetch(&rococo::storage().balances().total_issuance()) + .fetch(&westend::storage().balances().total_issuance()) .await .unwrap() .unwrap(), @@ -206,7 +208,7 @@ async fn ti_watcher( let ti = api .storage() .at(block.reference()) - .fetch(&rococo::storage().balances().total_issuance()) + .fetch(&westend::storage().balances().total_issuance()) .await .unwrap() .unwrap() as i128; @@ -228,7 +230,7 @@ async fn coretime_revenue_test() -> Result<(), anyhow::Error> { let images = zombienet_sdk::environment::get_images_from_env(); let config = NetworkConfigBuilder::new() .with_relaychain(|r| { - r.with_chain("rococo-local") + r.with_chain("westend-local") .with_default_command("polkadot") .with_default_image(images.polkadot.as_str()) .with_genesis_overrides( @@ -242,7 +244,7 @@ async fn coretime_revenue_test() -> Result<(), anyhow::Error> { p.with_id(1005) .with_default_command("polkadot-parachain") .with_default_image(images.cumulus.as_str()) - .with_chain("coretime-rococo-local") + .with_chain("coretime-westend-local") .with_collator(|n| n.with_name("coretime")) }) .build() @@ -302,7 +304,7 @@ async fn coretime_revenue_test() -> Result<(), anyhow::Error> { relay_client .tx() .sign_and_submit_default( - &rococo::tx().xcm_pallet().teleport_assets( + &westend::tx().xcm_pallet().teleport_assets( VersionedLocation::V4(Location { parents: 0, interior: Junctions::X1([Junction::Parachain(1005)]), @@ -458,7 +460,7 @@ async fn coretime_revenue_test() -> Result<(), anyhow::Error> { let r = relay_client .tx() .sign_and_submit_then_watch_default( - &rococo::tx() + &westend::tx() .on_demand_assignment_provider() .place_order_allow_death(100_000_000, primitives::Id(100)), &bob, @@ -468,7 +470,7 @@ async fn coretime_revenue_test() -> Result<(), anyhow::Error> { .await?; let order = r - .find_first::()? + .find_first::()? .unwrap(); // As there's no spot traffic, Bob will only pay base fee @@ -536,7 +538,7 @@ async fn coretime_revenue_test() -> Result<(), anyhow::Error> { let r = relay_client .tx() .sign_and_submit_then_watch_default( - &rococo::tx() + &westend::tx() .on_demand_assignment_provider() .place_order_with_credits(100_000_000, primitives::Id(100)), &alice, @@ -546,7 +548,7 @@ async fn coretime_revenue_test() -> Result<(), anyhow::Error> { .await?; let order = r - .find_first::()? + .find_first::()? .unwrap(); assert_eq!(order.spot_price, ON_DEMAND_BASE_FEE); diff --git a/polkadot/zombienet_tests/smoke/0004-coretime-smoke-test.toml b/polkadot/zombienet_tests/smoke/0004-coretime-smoke-test.toml index 0bdb58fa1ef45..84efe350e65c7 100644 --- a/polkadot/zombienet_tests/smoke/0004-coretime-smoke-test.toml +++ b/polkadot/zombienet_tests/smoke/0004-coretime-smoke-test.toml @@ -3,7 +3,7 @@ timeout = 1000 [relaychain] default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}" -chain = "rococo-local" +chain = "westend-local" command = "polkadot" [[relaychain.nodes]] @@ -20,7 +20,7 @@ command = "polkadot" [[parachains]] id = 1005 -chain = "coretime-rococo-local" +chain = "coretime-westend-local" [parachains.collator] name = "coretime-collator"