From 56beecca7a4145c56c082b9bba80bba949bc6f7b Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 28 Jul 2022 18:18:59 +0200 Subject: [PATCH 01/39] [BridgeHub] Setup Rococo backbone parachain --- Cargo.lock | 58 ++ Cargo.toml | 1 + README.md | 4 + parachains/runtimes/bridge-hubs/README.md | 65 ++ .../bridge-hubs/bridge-hub-rococo/Cargo.toml | 139 ++++ .../bridge-hubs/bridge-hub-rococo/build.rs | 9 + .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 719 ++++++++++++++++++ .../src/weights/block_weights.rs | 46 ++ .../src/weights/extrinsic_weights.rs | 46 ++ .../bridge-hub-rococo/src/weights/mod.rs | 28 + .../src/weights/paritydb_weights.rs | 63 ++ .../src/weights/rocksdb_weights.rs | 63 ++ .../bridge-hub-rococo/src/xcm_config.rs | 221 ++++++ polkadot-parachain/Cargo.toml | 1 + .../src/chain_spec/bridge_hubs.rs | 182 +++++ polkadot-parachain/src/chain_spec/mod.rs | 1 + polkadot-parachain/src/command.rs | 42 + 17 files changed, 1688 insertions(+) create mode 100644 parachains/runtimes/bridge-hubs/README.md create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/build.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs create mode 100644 polkadot-parachain/src/chain_spec/bridge_hubs.rs diff --git a/Cargo.lock b/Cargo.lock index 0462b5b6e67..2194ced3192 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -725,6 +725,63 @@ dependencies = [ "thiserror", ] +[[package]] +name = "bridge-hub-rococo-runtime" +version = "0.1.0" +dependencies = [ + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-timestamp", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "log", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-session", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-xcm", + "parachain-info", + "parity-scale-codec", + "polkadot-parachain 0.9.27", + "polkadot-runtime-common", + "scale-info", + "serde", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-io", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + [[package]] name = "bs58" version = "0.4.0" @@ -7842,6 +7899,7 @@ version = "0.9.300" dependencies = [ "assert_cmd", "async-trait", + "bridge-hub-rococo-runtime", "clap", "collectives-polkadot-runtime", "contracts-rococo-runtime", diff --git a/Cargo.toml b/Cargo.toml index cacb7bea7f1..45d47c2ec0c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,7 @@ members = [ "parachains/runtimes/assets/statemint", "parachains/runtimes/assets/statemine", "parachains/runtimes/assets/westmint", + "parachains/runtimes/bridge-hubs/bridge-hub-rococo", "parachains/runtimes/collectives/collectives-polkadot", "parachains/runtimes/contracts/contracts-rococo", "parachains/runtimes/testing/penpal", diff --git a/README.md b/README.md index 3d6a47fbba6..7ac6ca2e518 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,10 @@ Refer to the [setup instructions below](#local-setup) to run a local network for See [the `contracts-rococo` readme](parachains/runtimes/contracts/contracts-rococo/README.md) for details. +## Bridge-hub 📝 + +See [the `bridge-hubs` readme](parachains/runtimes/bridge-hubs/README.md) for details. + ## Rococo 👑 [Rococo](https://polkadot.js.org/apps/?rpc=wss://rococo-rpc.polkadot.io) is becoming a [Community Parachain Testbed](https://polkadot.network/blog/rococo-revamp-becoming-a-community-parachain-testbed/) for parachain teams in the Polkadot ecosystem. It supports multiple parachains with the differentiation of long-term connections and recurring short-term connections, to see which parachains are currently connected and how long they will be connected for [see here](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-rpc.polkadot.io#/parachains). diff --git a/parachains/runtimes/bridge-hubs/README.md b/parachains/runtimes/bridge-hubs/README.md new file mode 100644 index 00000000000..9f89d42e2d2 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/README.md @@ -0,0 +1,65 @@ +# Bride-hubs Parachain + +Implementation of _BridgeHub_, a blockchain to support message passing between Substrate based chains like Polkadot and Kusama networks. + +_BridgeHub_ allows users to: + +- Passing arbitrary messages between different Substrate chains (Polkadot <-> Kusama). +-- Message passing is + +Every _BridgeHub_ is meant to be **_common good parachain_** with main responsibilities: +- sync finality proofs between relay chains +- sync finality proofs between BridgeHub parachains +- pass (XCM) messages between different BridgeHub parachains + +## How to test locally Rococo <-> Wococo + +### Deploy +``` +cd +cargo build --release --locked -p polkadot-parachain@0.9.220 + +mkdir -p ~/local_bridge_testing/bin + +rm ~/local_bridge_testing/bin/polkadot-parachain +cp target/release/polkadot-parachain ~/local_bridge_testing/bin/polkadot-parachain +ls -lrt ~/local_bridge_testing/bin/polkadot-parachain +``` + +### Run relay chain (Rococo) +``` + + +~/local_bridge_testing/bin/polkadot build-spec --chain rococo-local --disable-default-bootnode --raw > ~/local_bridge_testing/rococo-local-cfde.json +~/local_bridge_testing/bin/polkadot --chain ~/local_bridge_testing/rococo-local-cfde.json --alice --tmp +~/local_bridge_testing/bin/polkadot --chain ~/local_bridge_testing/rococo-local-cfde.json --bob --tmp --port 30334 +``` + +### Run Rococo BridgeHub parachain +#### Generate spec + genesis + wasm (paraId=1013) +``` +~/local_bridge_testing/bin/polkadot-parachain build-spec --chain bridge-hub-rococo-local --raw --disable-default-bootnode > ~/local_bridge_testing/bridge-hub-rococo-local-raw.json +~/local_bridge_testing/bin/polkadot-parachain export-genesis-state --chain ~/local_bridge_testing/bridge-hub-rococo-local-raw.json > ~/local_bridge_testing/bridge-hub-rococo-local-genesis +~/local_bridge_testing/bin/polkadot-parachain export-genesis-wasm --chain ~/local_bridge_testing/bridge-hub-rococo-local-raw.json > ~/local_bridge_testing/bridge-hub-rococo-local-genesis-wasm +``` + +#### Run collators +``` +~/local_bridge_testing/bin/polkadot-parachain --collator --alice --force-authoring --tmp --port 40335 --ws-port 9946 --chain ~/local_bridge_testing/bridge-hub-rococo-local-raw.json -- --execution wasm --chain ~/local_bridge_testing/rococo-local-cfde.json --port 30335 +~/local_bridge_testing/bin/polkadot-parachain --collator --bob --force-authoring --tmp --port 40336 --ws-port 9947 --chain ~/local_bridge_testing/bridge-hub-rococo-local-raw.json -- --execution wasm --chain ~/local_bridge_testing/rococo-local-cfde.json --port 30336 +``` + +#### Run parachain node +``` +~/local_bridge_testing/bin/polkadot-parachain --tmp --port 40337 --ws-port 9948 --chain ~/local_bridge_testing/bridge-hub-rococo-local-raw.json -- --execution wasm --chain ~/local_bridge_testing/rococo-local-cfde.json --port 30337 +``` + +#### Activate parachain (paraId=1013) +``` +https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer +``` + +#### After parachain activation, we should see new blocks in collator's node +``` +https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/parachains +``` diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml new file mode 100644 index 00000000000..2bf9f9867cf --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -0,0 +1,139 @@ +[package] +name = "bridge-hub-rococo-runtime" +version = "0.1.0" +authors = ["Parity Technologies "] +edition = "2021" +description = "Rococo's BridgeHub parachain runtime" + +[build-dependencies] +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +hex-literal = { version = "0.3.4", optional = true } +log = { version = "0.4.17", default-features = false } +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +serde = { version = "1.0.137", optional = true, features = ["derive"] } +smallvec = "1.8.1" + +# Substrate +frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "master" } +frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "master" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "master" } +pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } + +# Polkadot +pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } + +# Cumulus +cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false } +cumulus-pallet-dmp-queue = { path = "../../../../pallets/dmp-queue", default-features = false } +cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system", default-features = false } +cumulus-pallet-session-benchmarking = {path = "../../../../pallets/session-benchmarking", default-features = false, version = "3.0.0"} +cumulus-pallet-xcm = { path = "../../../../pallets/xcm", default-features = false } +cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false } +cumulus-primitives-core = { path = "../../../../primitives/core", default-features = false } +cumulus-primitives-timestamp = { path = "../../../../primitives/timestamp", default-features = false } +cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false } +pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false } +parachain-info = { path = "../../../../parachains/pallets/parachain-info", default-features = false } + +[features] +default = [ + "std", +] +std = [ + "codec/std", + "log/std", + "scale-info/std", + "serde", + "cumulus-pallet-aura-ext/std", + "cumulus-pallet-dmp-queue/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "frame-executive/std", + "frame-support/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "pallet-aura/std", + "pallet-authorship/std", + "pallet-balances/std", + "pallet-collator-selection/std", + "pallet-session/std", + "pallet-sudo/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-xcm/std", + "parachain-info/std", + "polkadot-parachain/std", + "polkadot-runtime-common/std", + "sp-api/std", + "sp-block-builder/std", + "sp-consensus-aura/std", + "sp-core/std", + "sp-inherents/std", + "sp-io/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-version/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm/std", +] + +runtime-benchmarks = [ + "hex-literal", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking", + "frame-system/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-collator-selection/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", +] + +try-runtime = [ + "frame-executive/try-runtime", + "frame-try-runtime", +] diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/build.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/build.rs new file mode 100644 index 00000000000..9b53d2457df --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/build.rs @@ -0,0 +1,9 @@ +use substrate_wasm_builder::WasmBuilder; + +fn main() { + WasmBuilder::new() + .with_current_project() + .export_heap_base() + .import_memory() + .build() +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs new file mode 100644 index 00000000000..9076081c28c --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -0,0 +1,719 @@ +// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +#![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 weights; +pub mod xcm_config; + +use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; +use smallvec::smallvec; +use sp_api::impl_runtime_apis; +use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; +use sp_runtime::{ + create_runtime_str, generic, impl_opaque_keys, + traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, IdentifyAccount, Verify}, + transaction_validity::{TransactionSource, TransactionValidity}, + ApplyExtrinsicResult, MultiSignature, +}; + +use sp_std::prelude::*; +#[cfg(feature = "std")] +use sp_version::NativeVersion; +use sp_version::RuntimeVersion; + +use frame_support::{ + construct_runtime, parameter_types, + traits::Everything, + weights::{ + constants::WEIGHT_PER_SECOND, ConstantMultiplier, DispatchClass, Weight, + WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, + }, + PalletId, +}; +use frame_system::{ + limits::{BlockLength, BlockWeights}, + EnsureRoot, +}; +pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; +pub use sp_runtime::{MultiAddress, Perbill, Permill}; +use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin}; + +#[cfg(any(feature = "std", test))] +pub use sp_runtime::BuildStorage; + +// Polkadot imports +use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; + +use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; + +// XCM Imports +use xcm::latest::prelude::BodyId; +use xcm_executor::XcmExecutor; + +/// Alias to 512-bit hash when used in the context of a transaction signature on the chain. +pub type Signature = MultiSignature; + +/// Some way of identifying an account on the chain. We intentionally make it equivalent +/// to the public key of our transaction signing scheme. +pub type AccountId = <::Signer as IdentifyAccount>::AccountId; + +/// Balance of an account. +pub type Balance = u128; + +/// Index of a transaction in the chain. +pub type Index = u32; + +/// A hash of some data used by the chain. +pub type Hash = sp_core::H256; + +/// An index to a block. +pub type BlockNumber = u32; + +/// The address format for describing accounts. +pub type Address = 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 SignedExtension to the basic transaction logic. +pub type SignedExtra = ( + 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; + +/// Extrinsic type that has already been checked. +pub type CheckedExtrinsic = generic::CheckedExtrinsic; + +/// Executive: handles dispatch to the various modules. +pub type Executive = frame_executive::Executive< + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPalletsWithSystem, +>; + +/// Handles converting a weight scalar to a fee value, based on the scale and granularity of the +/// node's balance type. +/// +/// This should typically create a mapping between the following ranges: +/// - `[0, MAXIMUM_BLOCK_WEIGHT]` +/// - `[Balance::min, Balance::max]` +/// +/// Yet, it can be used for any other sort of change to weight-fee. Some examples being: +/// - Setting it to `0` will essentially disable the weight fee. +/// - Setting it to `1` will cause the literal `#[weight = x]` values to be charged. +pub struct WeightToFee; +impl WeightToFeePolynomial for WeightToFee { + type Balance = Balance; + fn polynomial() -> WeightToFeeCoefficients { + // in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1 MILLIUNIT: + // in our template, we map to 1/10 of that, or 1/10 MILLIUNIT + let p = MILLIUNIT / 10; + let q = 100 * Balance::from(ExtrinsicBaseWeight::get()); + smallvec![WeightToFeeCoefficient { + degree: 1, + negative: false, + coeff_frac: Perbill::from_rational(p % q, q), + coeff_integer: p / q, + }] + } +} + +/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know +/// the specifics of the runtime. They can then be made to be agnostic over specific formats +/// of data like extrinsics, allowing for them to continue syncing the network through upgrades +/// to even the core data structures. +pub mod opaque { + use super::*; + use sp_runtime::{generic, traits::BlakeTwo256}; + + pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; + /// Opaque block header type. + pub type Header = generic::Header; + /// Opaque block type. + pub type Block = generic::Block; + /// Opaque block identifier type. + pub type BlockId = generic::BlockId; +} + +impl_opaque_keys! { + pub struct SessionKeys { + pub aura: Aura, + } +} + +#[sp_version::runtime_version] +pub const VERSION: RuntimeVersion = RuntimeVersion { + spec_name: create_runtime_str!("bridge-hub-rococo"), + impl_name: create_runtime_str!("bridge-hub-rococo"), + authoring_version: 1, + spec_version: 1, + impl_version: 0, + apis: RUNTIME_API_VERSIONS, + transaction_version: 1, + state_version: 1, +}; + +/// This determines the average expected block time that we are targeting. +/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. +/// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked +/// up by `pallet_aura` to implement `fn slot_duration()`. +/// +/// Change this to adjust the block time. +pub const MILLISECS_PER_BLOCK: u64 = 12000; + +// NOTE: Currently it is not possible to change the slot duration after the chain has started. +// Attempting to do so will brick block production. +pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; + +// Time is measured by 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; + +// Unit = the base number of indivisible units for balances +pub const UNIT: Balance = 1_000_000_000_000; +pub const MILLIUNIT: Balance = 1_000_000_000; +pub const MICROUNIT: Balance = 1_000_000; + +/// The existential deposit. Set to 1/10 of the Connected Relay Chain. +pub const EXISTENTIAL_DEPOSIT: Balance = MILLIUNIT; + +/// We assume that ~5% 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(5); + +/// 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 0.5 of a second of compute with a 12 second average block time. +const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; + +/// 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; + + // This part is copied from Substrate's `bin/node/runtime/src/lib.rs`. + // The `RuntimeBlockLength` and `RuntimeBlockWeights` exist here because the + // `DeletionWeightLimit` and `DeletionQueueDepth` depend on those to parameterize + // the lazy contract deletion. + 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: u16 = 42; +} + +// Configure FRAME pallets to include in runtime. + +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 Call = Call; + /// 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 Index = Index; + /// The index type for blocks. + type BlockNumber = BlockNumber; + /// The type for hashing blocks and tries. + type Hash = Hash; + /// The hashing algorithm used. + type Hashing = BlakeTwo256; + /// The header type. + type Header = generic::Header; + /// The ubiquitous event type. + type Event = Event; + /// The ubiquitous origin type. + type Origin = Origin; + /// 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; + /// The data to be stored in an account. + type AccountData = pallet_balances::AccountData; + /// What to do if a new account is created. + type OnNewAccount = (); + /// What to do if an account is fully reaped from the system. + type OnKilledAccount = (); + /// The weight of database operations that the runtime can invoke. + type DbWeight = RocksDbWeight; + /// The basic call filter to use in dispatchable. + type BaseCallFilter = Everything; + /// Weight information for the extrinsics of this pallet. + type SystemWeightInfo = (); + /// Block & extrinsics weights: base values and limits. + type BlockWeights = RuntimeBlockWeights; + /// The maximum length of a block (in bytes). + type BlockLength = RuntimeBlockLength; + /// This is used as an identifier of the chain. 42 is the generic substrate prefix. + type SS58Prefix = SS58Prefix; + /// The action to take on a Runtime Upgrade + type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +parameter_types! { + pub const MinimumPeriod: u64 = SLOT_DURATION / 2; +} + +impl pallet_timestamp::Config for Runtime { + /// A timestamp: milliseconds since the unix epoch. + type Moment = u64; + type OnTimestampSet = (); + type MinimumPeriod = MinimumPeriod; + type WeightInfo = (); +} + +parameter_types! { + pub const UncleGenerations: u32 = 0; +} + +impl pallet_authorship::Config for Runtime { + type FindAuthor = pallet_session::FindAccountFromAuthorIndex; + type UncleGenerations = UncleGenerations; + type FilterUncle = (); + type EventHandler = (CollatorSelection,); +} + +parameter_types! { + pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; + pub const MaxLocks: u32 = 50; + pub const MaxReserves: u32 = 50; +} + +impl pallet_balances::Config for Runtime { + type MaxLocks = MaxLocks; + /// The type for recording an account's balance. + type Balance = Balance; + /// The ubiquitous event type. + type Event = Event; + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = pallet_balances::weights::SubstrateWeight; + type MaxReserves = MaxReserves; + type ReserveIdentifier = [u8; 8]; +} + +parameter_types! { + /// Relay Chain `TransactionByteFee` / 10 + pub const TransactionByteFee: Balance = 10 * MICROUNIT; + pub const OperationalFeeMultiplier: u8 = 5; +} + +impl pallet_transaction_payment::Config for Runtime { + type Event = Event; + type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; + type WeightToFee = WeightToFee; + type LengthToFee = ConstantMultiplier; + type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; + type OperationalFeeMultiplier = OperationalFeeMultiplier; +} + +parameter_types! { + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; +} + +impl cumulus_pallet_parachain_system::Config for Runtime { + type Event = Event; + type OnSystemEvent = (); + type SelfParaId = parachain_info::Pallet; + type OutboundXcmpMessageSource = XcmpQueue; + type DmpMessageHandler = DmpQueue; + type ReservedDmpWeight = ReservedDmpWeight; + type XcmpMessageHandler = XcmpQueue; + type ReservedXcmpWeight = ReservedXcmpWeight; + type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; +} + +impl parachain_info::Config for Runtime {} + +impl cumulus_pallet_aura_ext::Config for Runtime {} + +impl cumulus_pallet_xcmp_queue::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor; + type ChannelInfo = ParachainSystem; + type VersionWrapper = (); + type ExecuteOverweightOrigin = EnsureRoot; + type ControllerOrigin = EnsureRoot; + type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; + type WeightInfo = (); +} + +impl cumulus_pallet_dmp_queue::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor; + type ExecuteOverweightOrigin = EnsureRoot; +} + +parameter_types! { + pub const Period: u32 = 6 * HOURS; + pub const Offset: u32 = 0; + pub const MaxAuthorities: u32 = 100_000; +} + +impl pallet_session::Config for Runtime { + type Event = Event; + 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; + type NextSessionRotation = pallet_session::PeriodicSessions; + type SessionManager = CollatorSelection; + // Essentially just Aura, but lets be pedantic. + type SessionHandler = ::KeyTypeIdProviders; + type Keys = SessionKeys; + type WeightInfo = (); +} + +impl pallet_aura::Config for Runtime { + type AuthorityId = AuraId; + type DisabledValidators = (); + type MaxAuthorities = MaxAuthorities; +} + +parameter_types! { + pub const PotId: PalletId = PalletId(*b"PotStake"); + pub const MaxCandidates: u32 = 1000; + pub const MinCandidates: u32 = 5; + pub const SessionLength: BlockNumber = 6 * HOURS; + pub const MaxInvulnerables: u32 = 100; + pub const ExecutiveBody: BodyId = BodyId::Executive; +} + +// We allow root only to execute privileged collator selection operations. +pub type CollatorSelectionUpdateOrigin = EnsureRoot; + +impl pallet_collator_selection::Config for Runtime { + type Event = Event; + type Currency = Balances; + type UpdateOrigin = CollatorSelectionUpdateOrigin; + type PotId = PotId; + type MaxCandidates = MaxCandidates; + type MinCandidates = MinCandidates; + type MaxInvulnerables = MaxInvulnerables; + // should be a multiple of session or things will get inconsistent + type KickThreshold = Period; + type ValidatorId = ::AccountId; + type ValidatorIdOf = pallet_collator_selection::IdentityCollator; + type ValidatorRegistration = Session; + type WeightInfo = (); +} + +// Create the runtime by composing the FRAME pallets that were previously configured. +construct_runtime!( + pub enum Runtime where + Block = Block, + NodeBlock = opaque::Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + // System support stuff. + System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, + ParachainSystem: cumulus_pallet_parachain_system::{ + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + } = 1, + Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, + + // Monetary stuff. + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, + + // Collator support. The order of these 4 are important and shall not change. + Authorship: pallet_authorship::{Pallet, Call, Storage} = 20, + CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, + Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, + Aura: pallet_aura::{Pallet, Storage, Config} = 23, + AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + + // XCM helpers. + XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, + PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 31, + CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, + DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 33, + } +); + +#[cfg(feature = "runtime-benchmarks")] +#[macro_use] +extern crate frame_benchmarking; + +#[cfg(feature = "runtime-benchmarks")] +mod benches { + define_benchmarks!( + [frame_system, SystemBench::] + [pallet_balances, Balances] + [pallet_session, SessionBench::] + [pallet_timestamp, Timestamp] + [pallet_collator_selection, CollatorSelection] + [cumulus_pallet_xcmp_queue, XcmpQueue] + ); +} + +impl_runtime_apis! { + 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 { + Aura::authorities().into_inner() + } + } + + impl sp_api::Core for Runtime { + fn version() -> RuntimeVersion { + VERSION + } + + fn execute_block(block: Block) { + Executive::execute_block(block) + } + + fn initialize_block(header: &::Header) { + Executive::initialize_block(header) + } + } + + impl sp_api::Metadata for Runtime { + fn metadata() -> OpaqueMetadata { + OpaqueMetadata::new(Runtime::metadata().into()) + } + } + + 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: Block, + 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) -> Index { + 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) + } + } + + 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() -> (Weight, Weight) { + log::info!("try-runtime::on_runtime_upgrade parachain-template."); + let weight = Executive::try_runtime_upgrade().unwrap(); + (weight, RuntimeBlockWeights::get().max_block) + } + + fn execute_block_no_check(block: Block) -> Weight { + Executive::execute_block_no_check(block) + } + } + + #[cfg(feature = "runtime-benchmarks")] + impl frame_benchmarking::Benchmark for Runtime { + fn benchmark_metadata(extra: bool) -> ( + Vec, + Vec, + ) { + use frame_benchmarking::{Benchmarking, BenchmarkList}; + use frame_support::traits::StorageInfoTrait; + use frame_system_benchmarking::Pallet as SystemBench; + use cumulus_pallet_session_benchmarking::Pallet as SessionBench; + + let mut list = Vec::::new(); + list_benchmarks!(list, extra); + + let storage_info = AllPalletsWithSystem::storage_info(); + return (list, storage_info) + } + + fn dispatch_benchmark( + config: frame_benchmarking::BenchmarkConfig + ) -> Result, sp_runtime::RuntimeString> { + use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey}; + + use frame_system_benchmarking::Pallet as SystemBench; + impl frame_system_benchmarking::Config for Runtime {} + + use cumulus_pallet_session_benchmarking::Pallet as SessionBench; + impl cumulus_pallet_session_benchmarking::Config for Runtime {} + + let whitelist: Vec = vec![ + // Block Number + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(), + // Total Issuance + hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(), + // Execution Phase + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(), + // Event Count + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(), + // System Events + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(), + ]; + + let mut batches = Vec::::new(); + let params = (&config, &whitelist); + add_benchmarks!(params, batches); + + if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } + Ok(batches) + } + } +} + +struct CheckInherents; + +impl cumulus_pallet_parachain_system::CheckInherents for CheckInherents { + fn check_inherents( + block: &Block, + relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof, + ) -> sp_inherents::CheckInherentsResult { + let relay_chain_slot = relay_state_proof + .read_slot() + .expect("Could not read the relay chain slot from the proof"); + + let inherent_data = + cumulus_primitives_timestamp::InherentDataProvider::from_relay_chain_slot_and_duration( + relay_chain_slot, + sp_std::time::Duration::from_secs(6), + ) + .create_inherent_data() + .expect("Could not create the timestamp inherent data"); + + inherent_data.check_extrinsics(block) + } +} + +cumulus_pallet_parachain_system::register_validate_block! { + Runtime = Runtime, + BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, + CheckInherents = CheckInherents, +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs new file mode 100644 index 00000000000..4db90f0c020 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs @@ -0,0 +1,46 @@ +// This file is part of Substrate. + +// 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 = 5_000_000 * constants::WEIGHT_PER_NANOS; + } + + #[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 >= 100 * constants::WEIGHT_PER_MICROS, "Weight should be at least 100 µs."); + // At most 50 ms. + assert!(w <= 50 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + } + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs new file mode 100644 index 00000000000..158ba99c6a4 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs @@ -0,0 +1,46 @@ +// This file is part of Substrate. + +// 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 = 125_000 * constants::WEIGHT_PER_NANOS; + } + + #[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 >= 10 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + // At most 1 ms. + assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + } + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs new file mode 100644 index 00000000000..ed0b4dbcd47 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs @@ -0,0 +1,28 @@ +// This file is part of Substrate. + +// 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 extrinsic_weights; +pub mod paritydb_weights; +pub mod rocksdb_weights; + +pub use block_weights::constants::BlockExecutionWeight; +pub use extrinsic_weights::constants::ExtrinsicBaseWeight; +pub use paritydb_weights::constants::ParityDbWeight; +pub use rocksdb_weights::constants::RocksDbWeight; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs new file mode 100644 index 00000000000..843823c1bf3 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs @@ -0,0 +1,63 @@ +// This file is part of Substrate. + +// 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_PER_NANOS, + write: 50_000 * constants::WEIGHT_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) >= constants::WEIGHT_PER_MICROS, + "Read weight should be at least 1 µs." + ); + assert!( + W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + "Write weight should be at least 1 µs." + ); + // At most 1 ms. + assert!( + W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + "Read weight should be at most 1 ms." + ); + assert!( + W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + "Write weight should be at most 1 ms." + ); + } + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs new file mode 100644 index 00000000000..05e06b0eabe --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs @@ -0,0 +1,63 @@ +// This file is part of Substrate. + +// 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_PER_NANOS, + write: 100_000 * constants::WEIGHT_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) >= constants::WEIGHT_PER_MICROS, + "Read weight should be at least 1 µs." + ); + assert!( + W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + "Write weight should be at least 1 µs." + ); + // At most 1 ms. + assert!( + W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + "Read weight should be at most 1 ms." + ); + assert!( + W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + "Write weight should be at most 1 ms." + ); + } + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs new file mode 100644 index 00000000000..2ec84d18871 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -0,0 +1,221 @@ +use super::{ + AccountId, Balances, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, + WeightToFee, XcmpQueue, +}; +use core::marker::PhantomData; +use frame_support::{ + log, match_types, parameter_types, + traits::{Everything, Nothing}, + weights::Weight, +}; +use pallet_xcm::XcmPassthrough; +use polkadot_parachain::primitives::Sibling; +use polkadot_runtime_common::impls::ToAuthor; +use xcm::latest::prelude::*; +use xcm_builder::{ + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, + EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + UsingComponents, +}; +use xcm_executor::{traits::ShouldExecute, XcmExecutor}; + +parameter_types! { + pub const RelayLocation: MultiLocation = MultiLocation::parent(); + pub const RelayNetwork: NetworkId = NetworkId::Any; + pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); +} + +/// Type for specifying how a `MultiLocation` 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 LocalAssetTransactor = CurrencyAdapter< + // 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 MultiLocation 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. + (), +>; + +/// 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 converts to a `Relay` origin when + // recognized. + RelayChainAsNative, + // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when + // recognized. + SiblingParachainAsNative, + // Native signed account converter; this just converts an `AccountId32` origin into a normal + // `Origin::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 = 1_000_000_000; + pub const MaxInstructions: u32 = 100; +} + +match_types! { + pub type ParentOrParentsExecutivePlurality: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } + }; +} + +//TODO: move DenyThenTry to polkadot's xcm module. +/// Deny executing the xcm message if it matches any of the Deny filter regardless of anything else. +/// If it passes the Deny, and matches one of the Allow cases then it is let through. +pub struct DenyThenTry(PhantomData, PhantomData) +where + Deny: ShouldExecute, + Allow: ShouldExecute; + +impl ShouldExecute for DenyThenTry +where + Deny: ShouldExecute, + Allow: ShouldExecute, +{ + fn should_execute( + origin: &MultiLocation, + message: &mut Xcm, + max_weight: Weight, + weight_credit: &mut Weight, + ) -> Result<(), ()> { + Deny::should_execute(origin, message, max_weight, weight_credit)?; + Allow::should_execute(origin, message, max_weight, weight_credit) + } +} + +// See issue #5233 +pub struct DenyReserveTransferToRelayChain; +impl ShouldExecute for DenyReserveTransferToRelayChain { + fn should_execute( + origin: &MultiLocation, + message: &mut Xcm, + _max_weight: Weight, + _weight_credit: &mut Weight, + ) -> Result<(), ()> { + if message.0.iter().any(|inst| { + matches!( + inst, + InitiateReserveWithdraw { + reserve: MultiLocation { parents: 1, interior: Here }, + .. + } | DepositReserveAsset { dest: MultiLocation { parents: 1, interior: Here }, .. } | + TransferReserveAsset { + dest: MultiLocation { parents: 1, interior: Here }, + .. + } + ) + }) { + return Err(()) // Deny + } + + // An unexpected reserve transfer has arrived from the Relay Chain. Generally, `IsReserve` + // should not allow this, but we just log it here. + if matches!(origin, MultiLocation { parents: 1, interior: Here }) && + message.0.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. })) + { + log::warn!( + target: "xcm::barriers", + "Unexpected ReserveAssetDeposited from the Relay Chain", + ); + } + // Permit everything else + Ok(()) + } +} + +pub type Barrier = DenyThenTry< + DenyReserveTransferToRelayChain, + ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + AllowUnpaidExecutionFrom, + // ^^^ Parent and its exec plurality get free execution + ), +>; + +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type Call = Call; + type XcmSender = XcmRouter; + // How to withdraw and deposit an asset. + type AssetTransactor = LocalAssetTransactor; + type OriginConverter = XcmOriginToTransactDispatchOrigin; + type IsReserve = NativeAsset; + type IsTeleporter = (); // Teleporting is disabled. + type LocationInverter = LocationInverter; + type Barrier = Barrier; + type Weigher = FixedWeightBounds; + type Trader = + UsingComponents>; + type ResponseHandler = PolkadotXcm; + type AssetTrap = PolkadotXcm; + type AssetClaims = PolkadotXcm; + type SubscriptionService = PolkadotXcm; +} + +/// No local origins on this chain are allowed to dispatch XCM sends/executions. +pub type LocalOriginToLocation = SignedToAccountId32; + +/// The means for routing XCM messages which are not for local execution into the right message +/// queues. +pub type XcmRouter = ( + // 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 Event = Event; + type SendXcmOrigin = EnsureXcmOrigin; + type XcmRouter = XcmRouter; + type ExecuteXcmOrigin = EnsureXcmOrigin; + type XcmExecuteFilter = Nothing; + // ^ Disable dispatchable execute on the XCM pallet. + // Needs to be `Everything` for local testing. + type XcmExecutor = XcmExecutor; + type XcmTeleportFilter = Everything; + type XcmReserveTransferFilter = Nothing; + type Weigher = FixedWeightBounds; + type LocationInverter = LocationInverter; + type Origin = Origin; + type Call = Call; + + const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; + // ^ Override for AdvertisedXcmVersion default + type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; +} + +impl cumulus_pallet_xcm::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor; +} diff --git a/polkadot-parachain/Cargo.toml b/polkadot-parachain/Cargo.toml index a871294aad9..cfd50043dda 100644 --- a/polkadot-parachain/Cargo.toml +++ b/polkadot-parachain/Cargo.toml @@ -24,6 +24,7 @@ statemine-runtime = { path = "../parachains/runtimes/assets/statemine" } westmint-runtime = { path = "../parachains/runtimes/assets/westmint" } collectives-polkadot-runtime = { path = "../parachains/runtimes/collectives/collectives-polkadot" } contracts-rococo-runtime = { path = "../parachains/runtimes/contracts/contracts-rococo" } +bridge-hub-rococo-runtime = { path = "../parachains/runtimes/bridge-hubs/bridge-hub-rococo" } penpal-runtime = { path = "../parachains/runtimes/testing/penpal" } jsonrpsee = { version = "0.15.1", features = ["server"] } parachains-common = { path = "../parachains/common" } diff --git a/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/polkadot-parachain/src/chain_spec/bridge_hubs.rs new file mode 100644 index 00000000000..9091fb82c88 --- /dev/null +++ b/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -0,0 +1,182 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +use polkadot_service::ParaId; +use sc_chain_spec::ChainSpec; +use sc_cli::RuntimeVersion; +use std::{path::PathBuf, str::FromStr}; + +/// Collects all supported BridgeHub configurations +pub enum BridgeHubRuntimeType { + RococoLocal, +} + +impl FromStr for BridgeHubRuntimeType { + type Err = String; + + fn from_str(value: &str) -> Result { + match value { + rococo::BRIDGE_HUB_ROCOCO_LOCAL => Ok(BridgeHubRuntimeType::RococoLocal), + _ => Err(format!("Value '{}' is not configured yet", value)), + } + } +} + +impl BridgeHubRuntimeType { + pub const ID_PREFIX: &'static str = "bridge-hub"; + + pub fn chain_spec_from_json_file(&self, path: PathBuf) -> Result, String> { + Ok(Box::new(match self { + BridgeHubRuntimeType::RococoLocal => rococo::BridgeHubChainSpec::from_json_file(path)?, + })) + } + + pub fn load_config(&self) -> Box { + Box::new(match self { + BridgeHubRuntimeType::RococoLocal => + rococo::local_config("rococo-local", ParaId::new(1013)), + }) + } + + pub fn runtime_version(&self) -> &'static RuntimeVersion { + match self { + BridgeHubRuntimeType::RococoLocal => &bridge_hub_rococo_runtime::VERSION, + } + } +} + +/// Check if 'id' satisfy BridgeHub-like format +fn ensure_id(id: &str) -> Result<&str, String> { + if id.starts_with(BridgeHubRuntimeType::ID_PREFIX) { + Ok(id) + } else { + Err(format!( + "Invalid 'id' attribute ({}), should start with prefix: {}", + id, + BridgeHubRuntimeType::ID_PREFIX + )) + } +} + +pub mod rococo { + use crate::chain_spec::{ + get_account_id_from_seed, get_collator_keys_from_seed, Extensions, SAFE_XCM_VERSION, + }; + use bridge_hub_rococo_runtime::{AccountId, AuraId}; + use cumulus_primitives_core::ParaId; + use sc_chain_spec::ChainType; + use sp_core::sr25519; + + pub const BRIDGE_HUB_ROCOCO_LOCAL: &str = "bridge-hub-rococo-local"; + + /// Specialized `ChainSpec` for the normal parachain runtime. + pub type BridgeHubChainSpec = + sc_service::GenericChainSpec; + + pub fn local_config(relay_chain: &str, para_id: ParaId) -> BridgeHubChainSpec { + let properties = sc_chain_spec::Properties::new(); + // TODO: check + // properties.insert("ss58Format".into(), 2.into()); + // properties.insert("tokenSymbol".into(), "ROC".into()); + // properties.insert("tokenDecimals".into(), 12.into()); + + BridgeHubChainSpec::from_genesis( + // Name + "Rococo BrideHub Local", + // ID + super::ensure_id(BRIDGE_HUB_ROCOCO_LOCAL).expect("invalid id"), + ChainType::Local, + move || { + genesis( + // initial collators. + vec![ + ( + get_account_id_from_seed::("Alice"), + get_collator_keys_from_seed::("Alice"), + ), + ( + get_account_id_from_seed::("Bob"), + get_collator_keys_from_seed::("Bob"), + ), + ], + vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Charlie"), + get_account_id_from_seed::("Dave"), + get_account_id_from_seed::("Eve"), + get_account_id_from_seed::("Ferdie"), + get_account_id_from_seed::("Alice//stash"), + get_account_id_from_seed::("Bob//stash"), + get_account_id_from_seed::("Charlie//stash"), + get_account_id_from_seed::("Dave//stash"), + get_account_id_from_seed::("Eve//stash"), + get_account_id_from_seed::("Ferdie//stash"), + ], + para_id, + ) + }, + Vec::new(), + None, + None, + None, + Some(properties), + Extensions { relay_chain: relay_chain.to_string(), para_id: para_id.into() }, + ) + } + + fn genesis( + invulnerables: Vec<(AccountId, AuraId)>, + endowed_accounts: Vec, + id: ParaId, + ) -> bridge_hub_rococo_runtime::GenesisConfig { + bridge_hub_rococo_runtime::GenesisConfig { + system: bridge_hub_rococo_runtime::SystemConfig { + code: bridge_hub_rococo_runtime::WASM_BINARY + .expect("WASM binary was not build, please build it!") + .to_vec(), + }, + balances: bridge_hub_rococo_runtime::BalancesConfig { + balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), + }, + parachain_info: bridge_hub_rococo_runtime::ParachainInfoConfig { parachain_id: id }, + collator_selection: bridge_hub_rococo_runtime::CollatorSelectionConfig { + invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), + // TODO: check + candidacy_bond: 10, + ..Default::default() + }, + session: bridge_hub_rococo_runtime::SessionConfig { + keys: invulnerables + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + bridge_hub_rococo_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + }, + aura: Default::default(), + aura_ext: Default::default(), + parachain_system: Default::default(), + polkadot_xcm: bridge_hub_rococo_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, + } + } +} diff --git a/polkadot-parachain/src/chain_spec/mod.rs b/polkadot-parachain/src/chain_spec/mod.rs index 30cff43b57c..3637e915406 100644 --- a/polkadot-parachain/src/chain_spec/mod.rs +++ b/polkadot-parachain/src/chain_spec/mod.rs @@ -20,6 +20,7 @@ use serde::{Deserialize, Serialize}; use sp_core::{Pair, Public}; use sp_runtime::traits::{IdentifyAccount, Verify}; +pub mod bridge_hubs; pub mod collectives; pub mod contracts; pub mod penpal; diff --git a/polkadot-parachain/src/command.rs b/polkadot-parachain/src/command.rs index fbffbc03c1b..6a96e2d16e4 100644 --- a/polkadot-parachain/src/command.rs +++ b/polkadot-parachain/src/command.rs @@ -56,6 +56,7 @@ enum Runtime { ContractsRococo, CollectivesPolkadot, CollectivesWestend, + BridgeHub(chain_spec::bridge_hubs::BridgeHubRuntimeType), } trait RuntimeResolver { @@ -107,6 +108,11 @@ fn runtime(id: &str) -> Runtime { Runtime::CollectivesPolkadot } else if id.starts_with("collectives-westend") { Runtime::CollectivesWestend + } else if id.starts_with(chain_spec::bridge_hubs::BridgeHubRuntimeType::ID_PREFIX) { + Runtime::BridgeHub( + id.parse::() + .expect("Invalid value"), + ) } else { log::warn!("No specific runtime was recognized for ChainSpec's id: '{}', so Runtime::default() will be used", id); Runtime::default() @@ -191,6 +197,15 @@ fn load_spec(id: &str) -> std::result::Result, String> { &include_bytes!("../../parachains/chain-specs/contracts-rococo.json")[..], )?), + // -- BridgeHub + bridge_like_id + if bridge_like_id + .starts_with(chain_spec::bridge_hubs::BridgeHubRuntimeType::ID_PREFIX) => + bridge_like_id + .parse::() + .expect("invalid value") + .load_config(), + // -- Penpall "penpal-kusama" => Box::new(chain_spec::penpal::get_penpal_chain_spec( para_id.expect("Must specify parachain id"), @@ -226,6 +241,8 @@ fn load_spec(id: &str) -> std::result::Result, String> { Box::new(chain_spec::seedling::SeedlingChainSpec::from_json_file(path)?), Runtime::ContractsRococo => Box::new(chain_spec::contracts::ContractsRococoChainSpec::from_json_file(path)?), + Runtime::BridgeHub(bridge_hub_runtime_type) => + bridge_hub_runtime_type.chain_spec_from_json_file(path.into())?, Runtime::Penpal(_para_id) => Box::new(chain_spec::penpal::PenpalChainSpec::from_json_file(path)?), Runtime::Default => Box::new( @@ -303,6 +320,8 @@ impl SubstrateCli for Cli { Runtime::Shell => &shell_runtime::VERSION, Runtime::Seedling => &seedling_runtime::VERSION, Runtime::ContractsRococo => &contracts_rococo_runtime::VERSION, + Runtime::BridgeHub(bridge_hub_runtime_type) => + bridge_hub_runtime_type.runtime_version(), Runtime::Penpal(_) => &penpal_runtime::VERSION, Runtime::Default => &rococo_parachain_runtime::VERSION, } @@ -460,6 +479,19 @@ macro_rules! construct_async_run { { $( $code )* }.map(|v| (v, task_manager)) }) }, + Runtime::BridgeHub(bridge_hub_runtime_type) => { + runner.async_run(|$config| { + let $components = match bridge_hub_runtime_type { + chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal => new_partial::( + &$config, + crate::service::aura_build_import_queue::<_, AuraId>, + )?, + }; + + let task_manager = $components.task_manager; + { $( $code )* }.map(|v| (v, task_manager)) + }) + }, Runtime::Penpal(_) | Runtime::Default => { runner.async_run(|$config| { let $components = new_partial::< @@ -739,6 +771,16 @@ pub fn run() -> Result<()> { .await .map(|r| r.0) .map_err(Into::into), + Runtime::BridgeHub(bridge_hub_runtime_type) => match bridge_hub_runtime_type { + chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal => + crate::service::start_generic_aura_node::< + bridge_hub_rococo_runtime::RuntimeApi, + AuraId, + >(config, polkadot_config, collator_options, id, hwbench), + } + .await + .map(|r| r.0) + .map_err(Into::into), Runtime::Penpal(_) | Runtime::Default => crate::service::start_rococo_parachain_node( config, From 7ed6d06277466b105f467816885af4477e6d31fc Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Fri, 5 Aug 2022 10:57:12 +0200 Subject: [PATCH 02/39] [BridgeHub] Setup Wococo parachain backbone (reused from Rococo) [Bridge-Backport] Rebase-fix BridgeHub] Added zombienet startup tomls for Rococo/Wococo Fix typo --- Cargo.lock | 3 +- parachains/runtimes/bridge-hubs/README.md | 65 ------------------- .../bridge-hubs/bridge-hub-rococo/Cargo.toml | 1 + .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 14 ++-- .../src/chain_spec/bridge_hubs.rs | 51 ++++++++++++--- polkadot-parachain/src/command.rs | 15 ++++- 6 files changed, 63 insertions(+), 86 deletions(-) delete mode 100644 parachains/runtimes/bridge-hubs/README.md diff --git a/Cargo.lock b/Cargo.lock index 2194ced3192..8f3a1037579 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -758,8 +758,9 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "pallet-xcm", "parachain-info", + "parachains-common", "parity-scale-codec", - "polkadot-parachain 0.9.27", + "polkadot-parachain 0.9.29", "polkadot-runtime-common", "scale-info", "serde", diff --git a/parachains/runtimes/bridge-hubs/README.md b/parachains/runtimes/bridge-hubs/README.md deleted file mode 100644 index 9f89d42e2d2..00000000000 --- a/parachains/runtimes/bridge-hubs/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# Bride-hubs Parachain - -Implementation of _BridgeHub_, a blockchain to support message passing between Substrate based chains like Polkadot and Kusama networks. - -_BridgeHub_ allows users to: - -- Passing arbitrary messages between different Substrate chains (Polkadot <-> Kusama). --- Message passing is - -Every _BridgeHub_ is meant to be **_common good parachain_** with main responsibilities: -- sync finality proofs between relay chains -- sync finality proofs between BridgeHub parachains -- pass (XCM) messages between different BridgeHub parachains - -## How to test locally Rococo <-> Wococo - -### Deploy -``` -cd -cargo build --release --locked -p polkadot-parachain@0.9.220 - -mkdir -p ~/local_bridge_testing/bin - -rm ~/local_bridge_testing/bin/polkadot-parachain -cp target/release/polkadot-parachain ~/local_bridge_testing/bin/polkadot-parachain -ls -lrt ~/local_bridge_testing/bin/polkadot-parachain -``` - -### Run relay chain (Rococo) -``` - - -~/local_bridge_testing/bin/polkadot build-spec --chain rococo-local --disable-default-bootnode --raw > ~/local_bridge_testing/rococo-local-cfde.json -~/local_bridge_testing/bin/polkadot --chain ~/local_bridge_testing/rococo-local-cfde.json --alice --tmp -~/local_bridge_testing/bin/polkadot --chain ~/local_bridge_testing/rococo-local-cfde.json --bob --tmp --port 30334 -``` - -### Run Rococo BridgeHub parachain -#### Generate spec + genesis + wasm (paraId=1013) -``` -~/local_bridge_testing/bin/polkadot-parachain build-spec --chain bridge-hub-rococo-local --raw --disable-default-bootnode > ~/local_bridge_testing/bridge-hub-rococo-local-raw.json -~/local_bridge_testing/bin/polkadot-parachain export-genesis-state --chain ~/local_bridge_testing/bridge-hub-rococo-local-raw.json > ~/local_bridge_testing/bridge-hub-rococo-local-genesis -~/local_bridge_testing/bin/polkadot-parachain export-genesis-wasm --chain ~/local_bridge_testing/bridge-hub-rococo-local-raw.json > ~/local_bridge_testing/bridge-hub-rococo-local-genesis-wasm -``` - -#### Run collators -``` -~/local_bridge_testing/bin/polkadot-parachain --collator --alice --force-authoring --tmp --port 40335 --ws-port 9946 --chain ~/local_bridge_testing/bridge-hub-rococo-local-raw.json -- --execution wasm --chain ~/local_bridge_testing/rococo-local-cfde.json --port 30335 -~/local_bridge_testing/bin/polkadot-parachain --collator --bob --force-authoring --tmp --port 40336 --ws-port 9947 --chain ~/local_bridge_testing/bridge-hub-rococo-local-raw.json -- --execution wasm --chain ~/local_bridge_testing/rococo-local-cfde.json --port 30336 -``` - -#### Run parachain node -``` -~/local_bridge_testing/bin/polkadot-parachain --tmp --port 40337 --ws-port 9948 --chain ~/local_bridge_testing/bridge-hub-rococo-local-raw.json -- --execution wasm --chain ~/local_bridge_testing/rococo-local-cfde.json --port 30337 -``` - -#### Activate parachain (paraId=1013) -``` -https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer -``` - -#### After parachain activation, we should see new blocks in collator's node -``` -https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/parachains -``` diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index 2bf9f9867cf..ee91400f348 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -65,6 +65,7 @@ cumulus-primitives-timestamp = { path = "../../../../primitives/timestamp", defa cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false } pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false } parachain-info = { path = "../../../../parachains/pallets/parachain-info", default-features = false } +parachains-common = { path = "../../../../parachains/common", default-features = false } [features] default = [ diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 9076081c28c..79b79ff5857 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -31,9 +31,9 @@ use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, - traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, IdentifyAccount, Verify}, + traits::{AccountIdLookup, BlakeTwo256, Block as BlockT}, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, MultiSignature, + ApplyExtrinsicResult, }; use sp_std::prelude::*; @@ -43,7 +43,7 @@ use sp_version::RuntimeVersion; use frame_support::{ construct_runtime, parameter_types, - traits::Everything, + traits::{Everything, IsInVec}, weights::{ constants::WEIGHT_PER_SECOND, ConstantMultiplier, DispatchClass, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, @@ -67,16 +67,10 @@ use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; // XCM Imports +use parachains_common::{AccountId, Signature}; use xcm::latest::prelude::BodyId; use xcm_executor::XcmExecutor; -/// Alias to 512-bit hash when used in the context of a transaction signature on the chain. -pub type Signature = MultiSignature; - -/// Some way of identifying an account on the chain. We intentionally make it equivalent -/// to the public key of our transaction signing scheme. -pub type AccountId = <::Signer as IdentifyAccount>::AccountId; - /// Balance of an account. pub type Balance = u128; diff --git a/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/polkadot-parachain/src/chain_spec/bridge_hubs.rs index 9091fb82c88..aa89eede88e 100644 --- a/polkadot-parachain/src/chain_spec/bridge_hubs.rs +++ b/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -14,14 +14,16 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -use polkadot_service::ParaId; +use cumulus_primitives_core::ParaId; use sc_chain_spec::ChainSpec; use sc_cli::RuntimeVersion; use std::{path::PathBuf, str::FromStr}; /// Collects all supported BridgeHub configurations +#[derive(Debug, PartialEq)] pub enum BridgeHubRuntimeType { RococoLocal, + WococoLocal, } impl FromStr for BridgeHubRuntimeType { @@ -30,6 +32,7 @@ impl FromStr for BridgeHubRuntimeType { fn from_str(value: &str) -> Result { match value { rococo::BRIDGE_HUB_ROCOCO_LOCAL => Ok(BridgeHubRuntimeType::RococoLocal), + wococo::BRIDGE_HUB_WOCOCO_LOCAL => Ok(BridgeHubRuntimeType::WococoLocal), _ => Err(format!("Value '{}' is not configured yet", value)), } } @@ -41,19 +44,25 @@ impl BridgeHubRuntimeType { pub fn chain_spec_from_json_file(&self, path: PathBuf) -> Result, String> { Ok(Box::new(match self { BridgeHubRuntimeType::RococoLocal => rococo::BridgeHubChainSpec::from_json_file(path)?, + BridgeHubRuntimeType::WococoLocal => wococo::BridgeHubChainSpec::from_json_file(path)?, })) } pub fn load_config(&self) -> Box { Box::new(match self { BridgeHubRuntimeType::RococoLocal => - rococo::local_config("rococo-local", ParaId::new(1013)), + rococo::local_config("Rococo BrideHub Local", "rococo-local", ParaId::new(1013)), + BridgeHubRuntimeType::WococoLocal => + wococo::local_config("Wococo BrideHub Local", "wococo-local", ParaId::new(1013)), }) } pub fn runtime_version(&self) -> &'static RuntimeVersion { match self { - BridgeHubRuntimeType::RococoLocal => &bridge_hub_rococo_runtime::VERSION, + BridgeHubRuntimeType::RococoLocal | BridgeHubRuntimeType::WococoLocal => { + // this is intentional, for Rococo/Wococo we just want to have one runtime, which is configured for both sides + &bridge_hub_rococo_runtime::VERSION + }, } } } @@ -71,22 +80,29 @@ fn ensure_id(id: &str) -> Result<&str, String> { } } +/// Sub-module for Rococo setup pub mod rococo { + use super::ParaId; use crate::chain_spec::{ get_account_id_from_seed, get_collator_keys_from_seed, Extensions, SAFE_XCM_VERSION, }; - use bridge_hub_rococo_runtime::{AccountId, AuraId}; - use cumulus_primitives_core::ParaId; + use parachains_common::{AccountId, AuraId}; use sc_chain_spec::ChainType; use sp_core::sr25519; - pub const BRIDGE_HUB_ROCOCO_LOCAL: &str = "bridge-hub-rococo-local"; + pub(crate) const BRIDGE_HUB_ROCOCO_LOCAL: &str = "bridge-hub-rococo-local"; /// Specialized `ChainSpec` for the normal parachain runtime. pub type BridgeHubChainSpec = sc_service::GenericChainSpec; - pub fn local_config(relay_chain: &str, para_id: ParaId) -> BridgeHubChainSpec { + pub type RuntimeApi = bridge_hub_rococo_runtime::RuntimeApi; + + pub fn local_config( + chain_name: &str, + relay_chain: &str, + para_id: ParaId, + ) -> BridgeHubChainSpec { let properties = sc_chain_spec::Properties::new(); // TODO: check // properties.insert("ss58Format".into(), 2.into()); @@ -95,7 +111,7 @@ pub mod rococo { BridgeHubChainSpec::from_genesis( // Name - "Rococo BrideHub Local", + chain_name, // ID super::ensure_id(BRIDGE_HUB_ROCOCO_LOCAL).expect("invalid id"), ChainType::Local, @@ -180,3 +196,22 @@ pub mod rococo { } } } + +/// Sub-module for Wococo setup (reuses stuff from Rococo) +pub mod wococo { + use super::ParaId; + use crate::chain_spec::bridge_hubs::rococo; + + pub(crate) const BRIDGE_HUB_WOCOCO_LOCAL: &str = "bridge-hub-wococo-local"; + + pub type BridgeHubChainSpec = rococo::BridgeHubChainSpec; + pub type RuntimeApi = rococo::RuntimeApi; + + pub fn local_config( + chain_name: &str, + relay_chain: &str, + para_id: ParaId, + ) -> BridgeHubChainSpec { + rococo::local_config(chain_name, relay_chain, para_id) + } +} diff --git a/polkadot-parachain/src/command.rs b/polkadot-parachain/src/command.rs index 6a96e2d16e4..ae9110e0ef3 100644 --- a/polkadot-parachain/src/command.rs +++ b/polkadot-parachain/src/command.rs @@ -40,6 +40,8 @@ use sp_core::hexdisplay::HexDisplay; use sp_runtime::traits::{AccountIdConversion, Block as BlockT}; use std::{net::SocketAddr, path::PathBuf}; +use crate::chain_spec::bridge_hubs::BridgeHubRuntimeType; + /// Helper enum that is used for better distinction of different parachain/runtime configuration /// (it is based/calculated on ChainSpec's ID attribute) #[derive(Debug, PartialEq, Default)] @@ -482,7 +484,11 @@ macro_rules! construct_async_run { Runtime::BridgeHub(bridge_hub_runtime_type) => { runner.async_run(|$config| { let $components = match bridge_hub_runtime_type { - chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal => new_partial::( + chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal => new_partial::( + &$config, + crate::service::aura_build_import_queue::<_, AuraId>, + )?, + chain_spec::bridge_hubs::BridgeHubRuntimeType::WococoLocal => new_partial::( &$config, crate::service::aura_build_import_queue::<_, AuraId>, )?, @@ -774,7 +780,12 @@ pub fn run() -> Result<()> { Runtime::BridgeHub(bridge_hub_runtime_type) => match bridge_hub_runtime_type { chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal => crate::service::start_generic_aura_node::< - bridge_hub_rococo_runtime::RuntimeApi, + chain_spec::bridge_hubs::rococo::RuntimeApi, + AuraId, + >(config, polkadot_config, collator_options, id, hwbench), + chain_spec::bridge_hubs::BridgeHubRuntimeType::WococoLocal => + crate::service::start_generic_aura_node::< + chain_spec::bridge_hubs::wococo::RuntimeApi, AuraId, >(config, polkadot_config, collator_options, id, hwbench), } From 4420a0b3b32262757f2b44e34b3ba0ee8c0fe02d Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 3 Oct 2022 15:03:13 +0200 Subject: [PATCH 03/39] [BridgeHub] Added chain_spec for live Rococo/Wococo --- .../src/chain_spec/bridge_hubs.rs | 91 ++++++++++++++++++- polkadot-parachain/src/command.rs | 4 + 2 files changed, 91 insertions(+), 4 deletions(-) diff --git a/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/polkadot-parachain/src/chain_spec/bridge_hubs.rs index aa89eede88e..d8be71feb57 100644 --- a/polkadot-parachain/src/chain_spec/bridge_hubs.rs +++ b/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -22,7 +22,9 @@ use std::{path::PathBuf, str::FromStr}; /// Collects all supported BridgeHub configurations #[derive(Debug, PartialEq)] pub enum BridgeHubRuntimeType { + Rococo, RococoLocal, + Wococo, WococoLocal, } @@ -31,7 +33,9 @@ impl FromStr for BridgeHubRuntimeType { fn from_str(value: &str) -> Result { match value { + rococo::BRIDGE_HUB_ROCOCO => Ok(BridgeHubRuntimeType::Rococo), rococo::BRIDGE_HUB_ROCOCO_LOCAL => Ok(BridgeHubRuntimeType::RococoLocal), + wococo::BRIDGE_HUB_WOCOCO => Ok(BridgeHubRuntimeType::Wococo), wococo::BRIDGE_HUB_WOCOCO_LOCAL => Ok(BridgeHubRuntimeType::WococoLocal), _ => Err(format!("Value '{}' is not configured yet", value)), } @@ -43,22 +47,29 @@ impl BridgeHubRuntimeType { pub fn chain_spec_from_json_file(&self, path: PathBuf) -> Result, String> { Ok(Box::new(match self { + BridgeHubRuntimeType::Rococo => rococo::BridgeHubChainSpec::from_json_file(path)?, BridgeHubRuntimeType::RococoLocal => rococo::BridgeHubChainSpec::from_json_file(path)?, + BridgeHubRuntimeType::Wococo => wococo::BridgeHubChainSpec::from_json_file(path)?, BridgeHubRuntimeType::WococoLocal => wococo::BridgeHubChainSpec::from_json_file(path)?, })) } pub fn load_config(&self) -> Box { Box::new(match self { + BridgeHubRuntimeType::Rococo => + rococo::live_config(rococo::BRIDGE_HUB_ROCOCO, "Rococo BrideHub", "rococo", ParaId::new(1013)), BridgeHubRuntimeType::RococoLocal => - rococo::local_config("Rococo BrideHub Local", "rococo-local", ParaId::new(1013)), + rococo::local_config(rococo::BRIDGE_HUB_ROCOCO_LOCAL, "Rococo BrideHub Local", "rococo-local", ParaId::new(1013)), + BridgeHubRuntimeType::Wococo => + wococo::live_config(wococo::BRIDGE_HUB_WOCOCO, "Wococo BrideHub", "wococo", ParaId::new(1013)), BridgeHubRuntimeType::WococoLocal => - wococo::local_config("Wococo BrideHub Local", "wococo-local", ParaId::new(1013)), + wococo::local_config(wococo::BRIDGE_HUB_WOCOCO_LOCAL, "Wococo BrideHub Local", "wococo-local", ParaId::new(1013)), }) } pub fn runtime_version(&self) -> &'static RuntimeVersion { match self { + BridgeHubRuntimeType::Rococo | BridgeHubRuntimeType::Wococo | BridgeHubRuntimeType::RococoLocal | BridgeHubRuntimeType::WococoLocal => { // this is intentional, for Rococo/Wococo we just want to have one runtime, which is configured for both sides &bridge_hub_rococo_runtime::VERSION @@ -90,6 +101,7 @@ pub mod rococo { use sc_chain_spec::ChainType; use sp_core::sr25519; + pub(crate) const BRIDGE_HUB_ROCOCO: &str = "bridge-hub-rococo"; pub(crate) const BRIDGE_HUB_ROCOCO_LOCAL: &str = "bridge-hub-rococo-local"; /// Specialized `ChainSpec` for the normal parachain runtime. @@ -98,7 +110,67 @@ pub mod rococo { pub type RuntimeApi = bridge_hub_rococo_runtime::RuntimeApi; + pub fn live_config( + id: &str, + chain_name: &str, + relay_chain: &str, + para_id: ParaId, + ) -> BridgeHubChainSpec { + let properties = sc_chain_spec::Properties::new(); + // TODO: check + // properties.insert("ss58Format".into(), 2.into()); + // properties.insert("tokenSymbol".into(), "ROC".into()); + // properties.insert("tokenDecimals".into(), 12.into()); + + BridgeHubChainSpec::from_genesis( + // Name + chain_name, + // ID + super::ensure_id(id).expect("invalid id"), + ChainType::Live, + move || { + genesis( + // initial collators. + vec![ + ( + get_account_id_from_seed::("Alice"), + get_collator_keys_from_seed::("Alice"), + ), + ( + get_account_id_from_seed::("Bob"), + get_collator_keys_from_seed::("Bob"), + ), + ], + vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Charlie"), + get_account_id_from_seed::("Dave"), + get_account_id_from_seed::("Eve"), + get_account_id_from_seed::("Ferdie"), + get_account_id_from_seed::("Alice//stash"), + get_account_id_from_seed::("Bob//stash"), + get_account_id_from_seed::("Charlie//stash"), + get_account_id_from_seed::("Dave//stash"), + get_account_id_from_seed::("Eve//stash"), + get_account_id_from_seed::("Ferdie//stash"), + ], + para_id, + Some(get_account_id_from_seed::("Alice")), + Some(get_account_id_from_seed::("Bob")), + ) + }, + Vec::new(), + None, + None, + None, + Some(properties), + Extensions { relay_chain: relay_chain.to_string(), para_id: para_id.into() }, + ) + } + pub fn local_config( + id: &str, chain_name: &str, relay_chain: &str, para_id: ParaId, @@ -113,7 +185,7 @@ pub mod rococo { // Name chain_name, // ID - super::ensure_id(BRIDGE_HUB_ROCOCO_LOCAL).expect("invalid id"), + super::ensure_id(id).expect("invalid id"), ChainType::Local, move || { genesis( @@ -202,16 +274,27 @@ pub mod wococo { use super::ParaId; use crate::chain_spec::bridge_hubs::rococo; + pub(crate) const BRIDGE_HUB_WOCOCO: &str = "bridge-hub-wococo"; pub(crate) const BRIDGE_HUB_WOCOCO_LOCAL: &str = "bridge-hub-wococo-local"; pub type BridgeHubChainSpec = rococo::BridgeHubChainSpec; pub type RuntimeApi = rococo::RuntimeApi; pub fn local_config( + id: &str, + chain_name: &str, + relay_chain: &str, + para_id: ParaId, + ) -> BridgeHubChainSpec { + rococo::local_config(id, chain_name, relay_chain, para_id) + } + + pub fn live_config( + id: &str, chain_name: &str, relay_chain: &str, para_id: ParaId, ) -> BridgeHubChainSpec { - rococo::local_config(chain_name, relay_chain, para_id) + rococo::live_config(id, chain_name, relay_chain, para_id) } } diff --git a/polkadot-parachain/src/command.rs b/polkadot-parachain/src/command.rs index ae9110e0ef3..d5ffc48b173 100644 --- a/polkadot-parachain/src/command.rs +++ b/polkadot-parachain/src/command.rs @@ -484,10 +484,12 @@ macro_rules! construct_async_run { Runtime::BridgeHub(bridge_hub_runtime_type) => { runner.async_run(|$config| { let $components = match bridge_hub_runtime_type { + chain_spec::bridge_hubs::BridgeHubRuntimeType::Rococo | chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal => new_partial::( &$config, crate::service::aura_build_import_queue::<_, AuraId>, )?, + chain_spec::bridge_hubs::BridgeHubRuntimeType::Wococo | chain_spec::bridge_hubs::BridgeHubRuntimeType::WococoLocal => new_partial::( &$config, crate::service::aura_build_import_queue::<_, AuraId>, @@ -778,11 +780,13 @@ pub fn run() -> Result<()> { .map(|r| r.0) .map_err(Into::into), Runtime::BridgeHub(bridge_hub_runtime_type) => match bridge_hub_runtime_type { + chain_spec::bridge_hubs::BridgeHubRuntimeType::Rococo | chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal => crate::service::start_generic_aura_node::< chain_spec::bridge_hubs::rococo::RuntimeApi, AuraId, >(config, polkadot_config, collator_options, id, hwbench), + chain_spec::bridge_hubs::BridgeHubRuntimeType::Wococo | chain_spec::bridge_hubs::BridgeHubRuntimeType::WococoLocal => crate::service::start_generic_aura_node::< chain_spec::bridge_hubs::wococo::RuntimeApi, From 84ce2fa014cbafe66d6506f0f66b5b06d1c37ba1 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 5 Oct 2022 11:36:35 +0200 Subject: [PATCH 04/39] [BridgeHub] Clean bridge-hub-rococo runtime --- .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 74 +++++++------------ .../src/weights/block_weights.rs | 2 +- .../src/weights/extrinsic_weights.rs | 2 +- .../src/weights/paritydb_weights.rs | 4 +- .../src/weights/rocksdb_weights.rs | 4 +- .../bridge-hub-rococo/src/xcm_config.rs | 57 +++++++------- .../src/chain_spec/bridge_hubs.rs | 40 +++++++--- polkadot-parachain/src/command.rs | 2 - 8 files changed, 88 insertions(+), 97 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 79b79ff5857..6dbb4d0e4c1 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -42,11 +42,13 @@ use sp_version::NativeVersion; use sp_version::RuntimeVersion; use frame_support::{ - construct_runtime, parameter_types, - traits::{Everything, IsInVec}, + construct_runtime, + dispatch::DispatchClass, + parameter_types, + traits::Everything, weights::{ - constants::WEIGHT_PER_SECOND, ConstantMultiplier, DispatchClass, Weight, - WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, + ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, + WeightToFeePolynomial, }, PalletId, }; @@ -67,7 +69,10 @@ use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; // XCM Imports -use parachains_common::{AccountId, Signature}; +use parachains_common::{ + AccountId, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, + NORMAL_DISPATCH_RATIO, SLOT_DURATION, +}; use xcm::latest::prelude::BodyId; use xcm_executor::XcmExecutor; @@ -111,10 +116,11 @@ pub type SignedExtra = ( ); /// Unchecked extrinsic type as expected by this runtime. -pub type UncheckedExtrinsic = generic::UncheckedExtrinsic; +pub type UncheckedExtrinsic = + generic::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. pub type Executive = frame_executive::Executive< @@ -142,7 +148,7 @@ impl WeightToFeePolynomial for WeightToFee { // in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1 MILLIUNIT: // in our template, we map to 1/10 of that, or 1/10 MILLIUNIT let p = MILLIUNIT / 10; - let q = 100 * Balance::from(ExtrinsicBaseWeight::get()); + let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); smallvec![WeightToFeeCoefficient { degree: 1, negative: false, @@ -187,23 +193,6 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { state_version: 1, }; -/// This determines the average expected block time that we are targeting. -/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. -/// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked -/// up by `pallet_aura` to implement `fn slot_duration()`. -/// -/// Change this to adjust the block time. -pub const MILLISECS_PER_BLOCK: u64 = 12000; - -// NOTE: Currently it is not possible to change the slot duration after the chain has started. -// Attempting to do so will brick block production. -pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; - -// Time is measured by 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; - // Unit = the base number of indivisible units for balances pub const UNIT: Balance = 1_000_000_000_000; pub const MILLIUNIT: Balance = 1_000_000_000; @@ -212,17 +201,6 @@ pub const MICROUNIT: Balance = 1_000_000; /// The existential deposit. Set to 1/10 of the Connected Relay Chain. pub const EXISTENTIAL_DEPOSIT: Balance = MILLIUNIT; -/// We assume that ~5% 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(5); - -/// 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 0.5 of a second of compute with a 12 second average block time. -const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2; - /// The version information used to identify this runtime when compiled natively. #[cfg(feature = "std")] pub fn native_version() -> NativeVersion { @@ -265,7 +243,7 @@ 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 Call = Call; + 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. @@ -279,9 +257,9 @@ impl frame_system::Config for Runtime { /// The header type. type Header = generic::Header; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. - type Origin = Origin; + type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; /// Runtime version. @@ -345,7 +323,7 @@ impl pallet_balances::Config for Runtime { /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. - type Event = Event; + type RuntimeEvent = RuntimeEvent; type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; @@ -361,7 +339,7 @@ parameter_types! { } impl pallet_transaction_payment::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; @@ -370,12 +348,12 @@ impl pallet_transaction_payment::Config for Runtime { } parameter_types! { - pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; - pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4; + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); } impl cumulus_pallet_parachain_system::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; type OutboundXcmpMessageSource = XcmpQueue; @@ -391,7 +369,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; type VersionWrapper = (); @@ -402,7 +380,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { } impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ExecuteOverweightOrigin = EnsureRoot; } @@ -414,7 +392,7 @@ parameter_types! { } impl pallet_session::Config for Runtime { - type Event = Event; + 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; @@ -446,7 +424,7 @@ parameter_types! { pub type CollatorSelectionUpdateOrigin = EnsureRoot; impl pallet_collator_selection::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs index 4db90f0c020..4eaa2cba639 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Importing a block with 0 Extrinsics. - pub const BlockExecutionWeight: Weight = 5_000_000 * constants::WEIGHT_PER_NANOS; + pub const BlockExecutionWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(5_000_000); } #[cfg(test)] diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs index 158ba99c6a4..834374b6fad 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs @@ -23,7 +23,7 @@ pub mod constants { parameter_types! { /// Executing a NO-OP `System::remarks` Extrinsic. - pub const ExtrinsicBaseWeight: Weight = 125_000 * constants::WEIGHT_PER_NANOS; + pub const ExtrinsicBaseWeight: Weight = constants::WEIGHT_PER_NANOS.saturating_mul(125_000); } #[cfg(test)] diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs index 843823c1bf3..8083ccb4001 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// `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_PER_NANOS, - write: 50_000 * constants::WEIGHT_PER_NANOS, + read: 8_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 50_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs index 05e06b0eabe..1db87f143f3 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs @@ -25,8 +25,8 @@ pub mod constants { /// 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_PER_NANOS, - write: 100_000 * constants::WEIGHT_PER_NANOS, + read: 25_000 * constants::WEIGHT_PER_NANOS.ref_time(), + write: 100_000 * constants::WEIGHT_PER_NANOS.ref_time(), }; } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index 2ec84d18871..d70a2a3986f 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -1,17 +1,16 @@ use super::{ - AccountId, Balances, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, - WeightToFee, XcmpQueue, + AccountId, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, + RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, }; use core::marker::PhantomData; use frame_support::{ log, match_types, parameter_types, traits::{Everything, Nothing}, - weights::Weight, }; use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; use polkadot_runtime_common::impls::ToAuthor; -use xcm::latest::prelude::*; +use xcm::latest::{prelude::*, Weight as XCMWeight}; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset, ParentIsPreset, @@ -24,7 +23,7 @@ use xcm_executor::{traits::ShouldExecute, XcmExecutor}; parameter_types! { pub const RelayLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Any; - pub RelayChainOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); } @@ -61,23 +60,23 @@ 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, + SovereignSignedViaLocation, // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when // recognized. - RelayChainAsNative, + RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when // recognized. - SiblingParachainAsNative, + SiblingParachainAsNative, // Native signed account converter; this just converts an `AccountId32` origin into a normal // `Origin::Signed` origin of the same 32-byte value. - SignedAccountId32AsNative, + SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. - XcmPassthrough, + XcmPassthrough, ); parameter_types! { // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. - pub UnitWeightCost: Weight = 1_000_000_000; + pub UnitWeightCost: u64 = 1_000_000_000; pub const MaxInstructions: u32 = 100; } @@ -101,11 +100,11 @@ where Deny: ShouldExecute, Allow: ShouldExecute, { - fn should_execute( + fn should_execute( origin: &MultiLocation, - message: &mut Xcm, - max_weight: Weight, - weight_credit: &mut Weight, + message: &mut Xcm, + max_weight: XCMWeight, + weight_credit: &mut XCMWeight, ) -> Result<(), ()> { Deny::should_execute(origin, message, max_weight, weight_credit)?; Allow::should_execute(origin, message, max_weight, weight_credit) @@ -115,11 +114,11 @@ where // See issue #5233 pub struct DenyReserveTransferToRelayChain; impl ShouldExecute for DenyReserveTransferToRelayChain { - fn should_execute( + fn should_execute( origin: &MultiLocation, - message: &mut Xcm, - _max_weight: Weight, - _weight_credit: &mut Weight, + message: &mut Xcm, + _max_weight: XCMWeight, + _weight_credit: &mut XCMWeight, ) -> Result<(), ()> { if message.0.iter().any(|inst| { matches!( @@ -164,7 +163,7 @@ pub type Barrier = DenyThenTry< pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { - type Call = Call; + type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; // How to withdraw and deposit an asset. type AssetTransactor = LocalAssetTransactor; @@ -173,7 +172,7 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = (); // Teleporting is disabled. type LocationInverter = LocationInverter; type Barrier = Barrier; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type Trader = UsingComponents>; type ResponseHandler = PolkadotXcm; @@ -183,7 +182,7 @@ impl xcm_executor::Config for XcmConfig { } /// No local origins on this chain are allowed to dispatch XCM sends/executions. -pub type LocalOriginToLocation = SignedToAccountId32; +pub type LocalOriginToLocation = SignedToAccountId32; /// The means for routing XCM messages which are not for local execution into the right message /// queues. @@ -195,20 +194,20 @@ pub type XcmRouter = ( ); impl pallet_xcm::Config for Runtime { - type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; + type RuntimeEvent = RuntimeEvent; + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; - type ExecuteXcmOrigin = EnsureXcmOrigin; + type ExecuteXcmOrigin = EnsureXcmOrigin; type XcmExecuteFilter = Nothing; // ^ Disable dispatchable execute on the XCM pallet. // Needs to be `Everything` for local testing. type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; - type Weigher = FixedWeightBounds; + type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; // ^ Override for AdvertisedXcmVersion default @@ -216,6 +215,6 @@ impl pallet_xcm::Config for Runtime { } impl cumulus_pallet_xcm::Config for Runtime { - type Event = Event; + type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; } diff --git a/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/polkadot-parachain/src/chain_spec/bridge_hubs.rs index d8be71feb57..93daa8cee9c 100644 --- a/polkadot-parachain/src/chain_spec/bridge_hubs.rs +++ b/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -56,21 +56,39 @@ impl BridgeHubRuntimeType { pub fn load_config(&self) -> Box { Box::new(match self { - BridgeHubRuntimeType::Rococo => - rococo::live_config(rococo::BRIDGE_HUB_ROCOCO, "Rococo BrideHub", "rococo", ParaId::new(1013)), - BridgeHubRuntimeType::RococoLocal => - rococo::local_config(rococo::BRIDGE_HUB_ROCOCO_LOCAL, "Rococo BrideHub Local", "rococo-local", ParaId::new(1013)), - BridgeHubRuntimeType::Wococo => - wococo::live_config(wococo::BRIDGE_HUB_WOCOCO, "Wococo BrideHub", "wococo", ParaId::new(1013)), - BridgeHubRuntimeType::WococoLocal => - wococo::local_config(wococo::BRIDGE_HUB_WOCOCO_LOCAL, "Wococo BrideHub Local", "wococo-local", ParaId::new(1013)), + BridgeHubRuntimeType::Rococo => rococo::live_config( + rococo::BRIDGE_HUB_ROCOCO, + "Rococo BrideHub", + "rococo", + ParaId::new(1013), + ), + BridgeHubRuntimeType::RococoLocal => rococo::local_config( + rococo::BRIDGE_HUB_ROCOCO_LOCAL, + "Rococo BrideHub Local", + "rococo-local", + ParaId::new(1013), + ), + BridgeHubRuntimeType::Wococo => wococo::live_config( + wococo::BRIDGE_HUB_WOCOCO, + "Wococo BrideHub", + "wococo", + ParaId::new(1013), + ), + BridgeHubRuntimeType::WococoLocal => wococo::local_config( + wococo::BRIDGE_HUB_WOCOCO_LOCAL, + "Wococo BrideHub Local", + "wococo-local", + ParaId::new(1013), + ), }) } pub fn runtime_version(&self) -> &'static RuntimeVersion { match self { - BridgeHubRuntimeType::Rococo | BridgeHubRuntimeType::Wococo | - BridgeHubRuntimeType::RococoLocal | BridgeHubRuntimeType::WococoLocal => { + BridgeHubRuntimeType::Rococo | + BridgeHubRuntimeType::Wococo | + BridgeHubRuntimeType::RococoLocal | + BridgeHubRuntimeType::WococoLocal => { // this is intentional, for Rococo/Wococo we just want to have one runtime, which is configured for both sides &bridge_hub_rococo_runtime::VERSION }, @@ -156,8 +174,6 @@ pub mod rococo { get_account_id_from_seed::("Ferdie//stash"), ], para_id, - Some(get_account_id_from_seed::("Alice")), - Some(get_account_id_from_seed::("Bob")), ) }, Vec::new(), diff --git a/polkadot-parachain/src/command.rs b/polkadot-parachain/src/command.rs index d5ffc48b173..a3be72ec6a8 100644 --- a/polkadot-parachain/src/command.rs +++ b/polkadot-parachain/src/command.rs @@ -40,8 +40,6 @@ use sp_core::hexdisplay::HexDisplay; use sp_runtime::traits::{AccountIdConversion, Block as BlockT}; use std::{net::SocketAddr, path::PathBuf}; -use crate::chain_spec::bridge_hubs::BridgeHubRuntimeType; - /// Helper enum that is used for better distinction of different parachain/runtime configuration /// (it is based/calculated on ChainSpec's ID attribute) #[derive(Debug, PartialEq, Default)] From 384e65eabc6109b68efe0e3f98b34c3b739ea2ae Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 20 Sep 2022 10:54:47 +0200 Subject: [PATCH 05/39] [BridgeHub] Add bridge-hub-rococo to CI pipelines --- .github/workflows/release-30_create-draft.yml | 6 ++++++ .github/workflows/srtool.yml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/release-30_create-draft.yml b/.github/workflows/release-30_create-draft.yml index 68d0a383523..cd2956c50a2 100644 --- a/.github/workflows/release-30_create-draft.yml +++ b/.github/workflows/release-30_create-draft.yml @@ -50,6 +50,8 @@ jobs: runtime: statemint - category: assets runtime: westmint + - category: bridge-hubs + runtime: bridge-hub-rococo - category: collectives runtime: collectives-polkadot - category: contracts @@ -150,6 +152,7 @@ jobs: WESTMINT_DIGEST: ${{ github.workspace}}/westmint-srtool-json/westmint-srtool-digest.json STATEMINE_DIGEST: ${{ github.workspace}}/statemine-srtool-json/statemine-srtool-digest.json STATEMINT_DIGEST: ${{ github.workspace}}/statemint-srtool-json/statemint-srtool-digest.json + BRIDE_HUB_ROCOCO_DIGEST: ${{ github.workspace}}/bridge-hub-rococo-srtool-json/bridge-hub-rococo-srtool-digest.json COLLECTIVES_POLKADOT_DIGEST: ${{ github.workspace}}/collectives-polkadot-srtool-json/collectives-polkadot-srtool-digest.json ROCOCO_PARA_DIGEST: ${{ github.workspace}}/rococo-parachain-srtool-json/rococo-parachain-srtool-digest.json CANVAS_KUSAMA_DIGEST: ${{ github.workspace}}/contracts-rococo-srtool-json/contracts-rococo-srtool-digest.json @@ -165,6 +168,7 @@ jobs: ls -al $WESTMINT_DIGEST || true ls -al $STATEMINE_DIGEST || true ls -al $STATEMINT_DIGEST || true + ls -al $BRIDE_HUB_ROCOCO_DIGEST || true ls -al $COLLECTIVES_POLKADOT_DIGEST || true ls -al $ROCOCO_PARA_DIGEST || true ls -al $CANVAS_KUSAMA_DIGEST || true @@ -216,6 +220,8 @@ jobs: runtime: statemint - category: assets runtime: westmint + - category: bridge-hubs + runtime: bridge-hub-rococo - category: collectives runtime: collectives-polkadot - category: contracts diff --git a/.github/workflows/srtool.yml b/.github/workflows/srtool.yml index 85d3569ed8f..40ef3a9fc91 100644 --- a/.github/workflows/srtool.yml +++ b/.github/workflows/srtool.yml @@ -37,6 +37,8 @@ jobs: runtime: statemint - category: assets runtime: westmint + - category: bridge-hubs + runtime: bridge-hub-rococo - category: collectives runtime: collectives-polkadot - category: contracts From 3d29c5a48589b88320bdd8aa8bbef9257cc15c3a Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 5 Oct 2022 16:12:05 +0200 Subject: [PATCH 06/39] [BridgeHub] Added bridge-hub-kusama - empty runtime/chain_spec setup --- .github/workflows/release-30_create-draft.yml | 4 + .github/workflows/srtool.yml | 2 + Cargo.lock | 61 ++ Cargo.toml | 1 + parachains/chain-specs/bridge-hub-kusama.json | 1 + .../bridge-hubs/bridge-hub-kusama/Cargo.toml | 144 ++++ .../bridge-hubs/bridge-hub-kusama/build.rs | 9 + .../bridge-hub-kusama/src/constants.rs | 63 ++ .../bridge-hubs/bridge-hub-kusama/src/lib.rs | 654 ++++++++++++++++++ .../src/weights/block_weights.rs | 52 ++ .../src/weights/extrinsic_weights.rs | 49 ++ .../bridge-hub-kusama/src/weights/mod.rs | 28 + .../src/weights/paritydb_weights.rs | 63 ++ .../src/weights/rocksdb_weights.rs | 63 ++ .../bridge-hub-kusama/src/xcm_config.rs | 220 ++++++ .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 2 +- .../src/weights/block_weights.rs | 10 +- .../src/weights/paritydb_weights.rs | 8 +- .../src/weights/rocksdb_weights.rs | 8 +- polkadot-parachain/Cargo.toml | 1 + .../src/chain_spec/bridge_hubs.rs | 61 +- polkadot-parachain/src/command.rs | 73 +- 22 files changed, 1527 insertions(+), 50 deletions(-) create mode 100644 parachains/chain-specs/bridge-hub-kusama.json create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/build.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/constants.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/block_weights.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/extrinsic_weights.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/paritydb_weights.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/rocksdb_weights.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs diff --git a/.github/workflows/release-30_create-draft.yml b/.github/workflows/release-30_create-draft.yml index cd2956c50a2..2ce2f4d09f8 100644 --- a/.github/workflows/release-30_create-draft.yml +++ b/.github/workflows/release-30_create-draft.yml @@ -50,6 +50,8 @@ jobs: runtime: statemint - category: assets runtime: westmint + - category: bridge-hubs + runtime: bridge-hub-kusama - category: bridge-hubs runtime: bridge-hub-rococo - category: collectives @@ -220,6 +222,8 @@ jobs: runtime: statemint - category: assets runtime: westmint + - category: bridge-hubs + runtime: bridge-hub-kusama - category: bridge-hubs runtime: bridge-hub-rococo - category: collectives diff --git a/.github/workflows/srtool.yml b/.github/workflows/srtool.yml index 40ef3a9fc91..0dea74c5819 100644 --- a/.github/workflows/srtool.yml +++ b/.github/workflows/srtool.yml @@ -37,6 +37,8 @@ jobs: runtime: statemint - category: assets runtime: westmint + - category: bridge-hubs + runtime: bridge-hub-kusama - category: bridge-hubs runtime: bridge-hub-rococo - category: collectives diff --git a/Cargo.lock b/Cargo.lock index 8f3a1037579..d879625a2ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -725,6 +725,66 @@ dependencies = [ "thiserror", ] +[[package]] +name = "bridge-hub-kusama-runtime" +version = "0.1.0" +dependencies = [ + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-timestamp", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "kusama-runtime-constants", + "log", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-session", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-xcm", + "parachain-info", + "parachains-common", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain 0.9.29", + "polkadot-runtime-common", + "scale-info", + "serde", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-inherents", + "sp-io", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + [[package]] name = "bridge-hub-rococo-runtime" version = "0.1.0" @@ -7900,6 +7960,7 @@ version = "0.9.300" dependencies = [ "assert_cmd", "async-trait", + "bridge-hub-kusama-runtime", "bridge-hub-rococo-runtime", "clap", "collectives-polkadot-runtime", diff --git a/Cargo.toml b/Cargo.toml index 45d47c2ec0c..5db2ddd9a77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,6 +36,7 @@ members = [ "parachains/runtimes/assets/statemine", "parachains/runtimes/assets/westmint", "parachains/runtimes/bridge-hubs/bridge-hub-rococo", + "parachains/runtimes/bridge-hubs/bridge-hub-kusama", "parachains/runtimes/collectives/collectives-polkadot", "parachains/runtimes/contracts/contracts-rococo", "parachains/runtimes/testing/penpal", diff --git a/parachains/chain-specs/bridge-hub-kusama.json b/parachains/chain-specs/bridge-hub-kusama.json new file mode 100644 index 00000000000..b96b5d4afb1 --- /dev/null +++ b/parachains/chain-specs/bridge-hub-kusama.json @@ -0,0 +1 @@ +TODO: setup diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml new file mode 100644 index 00000000000..1b0b6a6efe8 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -0,0 +1,144 @@ +[package] +name = "bridge-hub-kusama-runtime" +version = "0.1.0" +authors = ["Parity Technologies "] +edition = "2021" +description = "Kusama's BridgeHub parachain runtime" + +[build-dependencies] +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +hex-literal = { version = "0.3.4", optional = true } +log = { version = "0.4.17", default-features = false } +scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } +serde = { version = "1.0.137", optional = true, features = ["derive"] } +smallvec = "1.8.1" + +# Substrate +frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "master" } +frame-executive = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "master" } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "master" } +pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-offchain = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } + +# Polkadot +kusama-runtime-constants = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } + +# Cumulus +cumulus-pallet-aura-ext = { path = "../../../../pallets/aura-ext", default-features = false } +cumulus-pallet-dmp-queue = { path = "../../../../pallets/dmp-queue", default-features = false } +cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system", default-features = false } +cumulus-pallet-session-benchmarking = {path = "../../../../pallets/session-benchmarking", default-features = false, version = "3.0.0"} +cumulus-pallet-xcm = { path = "../../../../pallets/xcm", default-features = false } +cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false } +cumulus-primitives-core = { path = "../../../../primitives/core", default-features = false } +cumulus-primitives-timestamp = { path = "../../../../primitives/timestamp", default-features = false } +cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false } +pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false } +parachain-info = { path = "../../../../parachains/pallets/parachain-info", default-features = false } +parachains-common = { path = "../../../../parachains/common", default-features = false } + +[features] +default = [ + "std", +] +std = [ + "codec/std", + "log/std", + "scale-info/std", + "serde", + "cumulus-pallet-aura-ext/std", + "cumulus-pallet-dmp-queue/std", + "cumulus-pallet-parachain-system/std", + "cumulus-pallet-xcm/std", + "cumulus-pallet-xcmp-queue/std", + "cumulus-primitives-core/std", + "cumulus-primitives-timestamp/std", + "cumulus-primitives-utility/std", + "frame-executive/std", + "frame-support/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "kusama-runtime-constants/std", + "pallet-aura/std", + "pallet-authorship/std", + "pallet-balances/std", + "pallet-collator-selection/std", + "pallet-session/std", + "pallet-sudo/std", + "pallet-timestamp/std", + "pallet-transaction-payment-rpc-runtime-api/std", + "pallet-transaction-payment/std", + "pallet-xcm/std", + "parachain-info/std", + "polkadot-core-primitives/std", + "polkadot-parachain/std", + "polkadot-runtime-common/std", + "sp-api/std", + "sp-block-builder/std", + "sp-consensus-aura/std", + "sp-core/std", + "sp-inherents/std", + "sp-io/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-version/std", + "xcm-builder/std", + "xcm-executor/std", + "xcm/std", +] + +runtime-benchmarks = [ + "hex-literal", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking", + "frame-system/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", + "pallet-collator-selection/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", + "xcm-builder/runtime-benchmarks", + "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "cumulus-pallet-xcmp-queue/runtime-benchmarks", +] + +try-runtime = [ + "frame-executive/try-runtime", + "frame-try-runtime", +] diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/build.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/build.rs new file mode 100644 index 00000000000..9b53d2457df --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/build.rs @@ -0,0 +1,9 @@ +use substrate_wasm_builder::WasmBuilder; + +fn main() { + WasmBuilder::new() + .with_current_project() + .export_heap_base() + .import_memory() + .build() +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/constants.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/constants.rs new file mode 100644 index 00000000000..158c003903e --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/constants.rs @@ -0,0 +1,63 @@ +// 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 currency { + use kusama_runtime_constants as constants; + use polkadot_core_primitives::Balance; + + /// The existential deposit. Set to 1/10 of its parent Relay Chain. + pub const EXISTENTIAL_DEPOSIT: Balance = constants::currency::EXISTENTIAL_DEPOSIT / 10; + + pub const CENTS: Balance = constants::currency::CENTS; + pub const MILLICENTS: Balance = constants::currency::MILLICENTS; +} + +/// Fee-related. +pub mod fee { + use frame_support::weights::{ + constants::ExtrinsicBaseWeight, WeightToFeeCoefficient, WeightToFeeCoefficients, + WeightToFeePolynomial, + }; + use polkadot_core_primitives::Balance; + use smallvec::smallvec; + pub use sp_runtime::Perbill; + + /// Handles converting a weight scalar to a fee value, based on the scale and granularity of the + /// node's balance type. + /// + /// This should typically create a mapping between the following ranges: + /// - [0, MAXIMUM_BLOCK_WEIGHT] + /// - [Balance::min, Balance::max] + /// + /// Yet, it can be used for any other sort of change to weight-fee. Some examples being: + /// - Setting it to `0` will essentially disable the weight fee. + /// - Setting it to `1` will cause the literal `#[weight = x]` values to be charged. + pub struct WeightToFee; + impl WeightToFeePolynomial for WeightToFee { + type Balance = Balance; + fn polynomial() -> WeightToFeeCoefficients { + // in Kusama, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT: + // in BridgeHub, we map to 1/10 of that, or 1/100 CENT + let p = super::currency::CENTS; + let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); + smallvec![WeightToFeeCoefficient { + degree: 1, + negative: false, + coeff_frac: Perbill::from_rational(p % q, q), + coeff_integer: p / q, + }] + } + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs new file mode 100644 index 00000000000..4de1fb99e27 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -0,0 +1,654 @@ +// Copyright 2022 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +#![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 constants; +mod weights; +pub mod xcm_config; + +use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; +use sp_api::impl_runtime_apis; +use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; +use sp_runtime::{ + create_runtime_str, generic, impl_opaque_keys, + traits::{AccountIdLookup, BlakeTwo256, Block as BlockT}, + transaction_validity::{TransactionSource, TransactionValidity}, + ApplyExtrinsicResult, +}; + +use sp_std::prelude::*; +#[cfg(feature = "std")] +use sp_version::NativeVersion; +use sp_version::RuntimeVersion; + +use constants::{currency::*, fee::WeightToFee}; +use frame_support::{ + construct_runtime, + dispatch::DispatchClass, + parameter_types, + traits::Everything, + weights::{ConstantMultiplier, Weight}, + PalletId, +}; +use frame_system::{ + limits::{BlockLength, BlockWeights}, + EnsureRoot, +}; +pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; +pub use sp_runtime::{MultiAddress, Perbill, Permill}; +use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin}; + +#[cfg(any(feature = "std", test))] +pub use sp_runtime::BuildStorage; + +// Polkadot imports +use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; + +use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; + +// XCM Imports +use parachains_common::{ + AccountId, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, + NORMAL_DISPATCH_RATIO, SLOT_DURATION, +}; +use xcm::latest::prelude::BodyId; +use xcm_executor::XcmExecutor; + +/// Balance of an account. +pub type Balance = u128; + +/// Index of a transaction in the chain. +pub type Index = u32; + +/// A hash of some data used by the chain. +pub type Hash = sp_core::H256; + +/// An index to a block. +pub type BlockNumber = u32; + +/// The address format for describing accounts. +pub type Address = 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 SignedExtension to the basic transaction logic. +pub type SignedExtra = ( + 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; + +/// Extrinsic type that has already been checked. +pub type CheckedExtrinsic = generic::CheckedExtrinsic; + +/// Executive: handles dispatch to the various modules. +pub type Executive = frame_executive::Executive< + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPalletsWithSystem, +>; + +/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know +/// the specifics of the runtime. They can then be made to be agnostic over specific formats +/// of data like extrinsics, allowing for them to continue syncing the network through upgrades +/// to even the core data structures. +pub mod opaque { + use super::*; + use sp_runtime::{generic, traits::BlakeTwo256}; + + pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; + /// Opaque block header type. + pub type Header = generic::Header; + /// Opaque block type. + pub type Block = generic::Block; + /// Opaque block identifier type. + pub type BlockId = generic::BlockId; +} + +impl_opaque_keys! { + pub struct SessionKeys { + pub aura: Aura, + } +} + +#[sp_version::runtime_version] +pub const VERSION: RuntimeVersion = RuntimeVersion { + spec_name: create_runtime_str!("bridge-hub-kusama"), + impl_name: create_runtime_str!("bridge-hub-kusama"), + authoring_version: 1, + spec_version: 1, + impl_version: 0, + apis: RUNTIME_API_VERSIONS, + transaction_version: 1, + state_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; + + // This part is copied from Substrate's `bin/node/runtime/src/lib.rs`. + // The `RuntimeBlockLength` and `RuntimeBlockWeights` exist here because the + // `DeletionWeightLimit` and `DeletionQueueDepth` depend on those to parameterize + // the lazy contract deletion. + 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 = 2; +} + +// Configure FRAME pallets to include in runtime. + +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 Index = Index; + /// The index type for blocks. + type BlockNumber = BlockNumber; + /// The type for hashing blocks and tries. + type Hash = Hash; + /// The hashing algorithm used. + type Hashing = BlakeTwo256; + /// The header type. + type Header = generic::Header; + /// 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; + /// The data to be stored in an account. + type AccountData = pallet_balances::AccountData; + /// What to do if a new account is created. + type OnNewAccount = (); + /// What to do if an account is fully reaped from the system. + type OnKilledAccount = (); + /// The weight of database operations that the runtime can invoke. + type DbWeight = RocksDbWeight; + /// The basic call filter to use in dispatchable. + type BaseCallFilter = Everything; + /// Weight information for the extrinsics of this pallet. + type SystemWeightInfo = (); + /// Block & extrinsics weights: base values and limits. + type BlockWeights = RuntimeBlockWeights; + /// The maximum length of a block (in bytes). + type BlockLength = RuntimeBlockLength; + /// This is used as an identifier of the chain. 42 is the generic substrate prefix. + type SS58Prefix = SS58Prefix; + /// The action to take on a Runtime Upgrade + type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +parameter_types! { + pub const MinimumPeriod: u64 = SLOT_DURATION / 2; +} + +impl pallet_timestamp::Config for Runtime { + /// A timestamp: milliseconds since the unix epoch. + type Moment = u64; + type OnTimestampSet = (); + type MinimumPeriod = MinimumPeriod; + type WeightInfo = (); +} + +parameter_types! { + pub const UncleGenerations: u32 = 0; +} + +impl pallet_authorship::Config for Runtime { + type FindAuthor = pallet_session::FindAccountFromAuthorIndex; + type UncleGenerations = UncleGenerations; + type FilterUncle = (); + type EventHandler = (CollatorSelection,); +} + +parameter_types! { + pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; + pub const MaxLocks: u32 = 50; + pub const MaxReserves: u32 = 50; +} + +impl pallet_balances::Config for Runtime { + type MaxLocks = MaxLocks; + /// The type for recording an account's balance. + type Balance = Balance; + /// The ubiquitous event type. + type RuntimeEvent = RuntimeEvent; + type DustRemoval = (); + type ExistentialDeposit = ExistentialDeposit; + type AccountStore = System; + type WeightInfo = pallet_balances::weights::SubstrateWeight; + type MaxReserves = MaxReserves; + type ReserveIdentifier = [u8; 8]; +} + +parameter_types! { + /// Relay Chain `TransactionByteFee` / 10 + pub const TransactionByteFee: Balance = 1 * MILLICENTS; + pub const OperationalFeeMultiplier: u8 = 5; +} + +impl pallet_transaction_payment::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; + type WeightToFee = WeightToFee; + type LengthToFee = ConstantMultiplier; + type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; + type OperationalFeeMultiplier = OperationalFeeMultiplier; +} + +parameter_types! { + pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); + pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); +} + +impl cumulus_pallet_parachain_system::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type OnSystemEvent = (); + type SelfParaId = parachain_info::Pallet; + type OutboundXcmpMessageSource = XcmpQueue; + type DmpMessageHandler = DmpQueue; + type ReservedDmpWeight = ReservedDmpWeight; + type XcmpMessageHandler = XcmpQueue; + type ReservedXcmpWeight = ReservedXcmpWeight; + type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; +} + +impl parachain_info::Config for Runtime {} + +impl cumulus_pallet_aura_ext::Config for Runtime {} + +impl cumulus_pallet_xcmp_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type XcmExecutor = XcmExecutor; + type ChannelInfo = ParachainSystem; + type VersionWrapper = (); + type ExecuteOverweightOrigin = EnsureRoot; + type ControllerOrigin = EnsureRoot; + type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; + type WeightInfo = (); +} + +impl cumulus_pallet_dmp_queue::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type XcmExecutor = XcmExecutor; + type ExecuteOverweightOrigin = EnsureRoot; +} + +parameter_types! { + pub const Period: u32 = 6 * HOURS; + pub const Offset: u32 = 0; + pub const MaxAuthorities: u32 = 100_000; +} + +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; + type NextSessionRotation = pallet_session::PeriodicSessions; + type SessionManager = CollatorSelection; + // Essentially just Aura, but lets be pedantic. + type SessionHandler = ::KeyTypeIdProviders; + type Keys = SessionKeys; + type WeightInfo = (); +} + +impl pallet_aura::Config for Runtime { + type AuthorityId = AuraId; + type DisabledValidators = (); + type MaxAuthorities = MaxAuthorities; +} + +parameter_types! { + pub const PotId: PalletId = PalletId(*b"PotStake"); + pub const MaxCandidates: u32 = 1000; + pub const MinCandidates: u32 = 5; + pub const SessionLength: BlockNumber = 6 * HOURS; + pub const MaxInvulnerables: u32 = 100; + pub const ExecutiveBody: BodyId = BodyId::Executive; +} + +// We allow root only to execute privileged collator selection operations. +pub type CollatorSelectionUpdateOrigin = EnsureRoot; + +impl pallet_collator_selection::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Currency = Balances; + type UpdateOrigin = CollatorSelectionUpdateOrigin; + type PotId = PotId; + type MaxCandidates = MaxCandidates; + type MinCandidates = MinCandidates; + type MaxInvulnerables = MaxInvulnerables; + // should be a multiple of session or things will get inconsistent + type KickThreshold = Period; + type ValidatorId = ::AccountId; + type ValidatorIdOf = pallet_collator_selection::IdentityCollator; + type ValidatorRegistration = Session; + type WeightInfo = (); +} + +// Create the runtime by composing the FRAME pallets that were previously configured. +construct_runtime!( + pub enum Runtime where + Block = Block, + NodeBlock = opaque::Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + // System support stuff. + System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, + ParachainSystem: cumulus_pallet_parachain_system::{ + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + } = 1, + Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, + + // Monetary stuff. + Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, + TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event} = 11, + + // Collator support. The order of these 4 are important and shall not change. + Authorship: pallet_authorship::{Pallet, Call, Storage} = 20, + CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, + Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, + Aura: pallet_aura::{Pallet, Storage, Config} = 23, + AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + + // XCM helpers. + XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, + PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 31, + CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, + DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 33, + } +); + +#[cfg(feature = "runtime-benchmarks")] +#[macro_use] +extern crate frame_benchmarking; + +#[cfg(feature = "runtime-benchmarks")] +mod benches { + define_benchmarks!( + [frame_system, SystemBench::] + [pallet_balances, Balances] + [pallet_session, SessionBench::] + [pallet_timestamp, Timestamp] + [pallet_collator_selection, CollatorSelection] + [cumulus_pallet_xcmp_queue, XcmpQueue] + ); +} + +impl_runtime_apis! { + 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 { + Aura::authorities().into_inner() + } + } + + impl sp_api::Core for Runtime { + fn version() -> RuntimeVersion { + VERSION + } + + fn execute_block(block: Block) { + Executive::execute_block(block) + } + + fn initialize_block(header: &::Header) { + Executive::initialize_block(header) + } + } + + impl sp_api::Metadata for Runtime { + fn metadata() -> OpaqueMetadata { + OpaqueMetadata::new(Runtime::metadata().into()) + } + } + + 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: Block, + 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) -> Index { + 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) + } + } + + 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() -> (Weight, Weight) { + log::info!("try-runtime::on_runtime_upgrade parachain-template."); + let weight = Executive::try_runtime_upgrade().unwrap(); + (weight, RuntimeBlockWeights::get().max_block) + } + + fn execute_block_no_check(block: Block) -> Weight { + Executive::execute_block_no_check(block) + } + } + + #[cfg(feature = "runtime-benchmarks")] + impl frame_benchmarking::Benchmark for Runtime { + fn benchmark_metadata(extra: bool) -> ( + Vec, + Vec, + ) { + use frame_benchmarking::{Benchmarking, BenchmarkList}; + use frame_support::traits::StorageInfoTrait; + use frame_system_benchmarking::Pallet as SystemBench; + use cumulus_pallet_session_benchmarking::Pallet as SessionBench; + + let mut list = Vec::::new(); + list_benchmarks!(list, extra); + + let storage_info = AllPalletsWithSystem::storage_info(); + return (list, storage_info) + } + + fn dispatch_benchmark( + config: frame_benchmarking::BenchmarkConfig + ) -> Result, sp_runtime::RuntimeString> { + use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey}; + + use frame_system_benchmarking::Pallet as SystemBench; + impl frame_system_benchmarking::Config for Runtime {} + + use cumulus_pallet_session_benchmarking::Pallet as SessionBench; + impl cumulus_pallet_session_benchmarking::Config for Runtime {} + + let whitelist: Vec = vec![ + // Block Number + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(), + // Total Issuance + hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(), + // Execution Phase + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(), + // Event Count + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(), + // System Events + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(), + ]; + + let mut batches = Vec::::new(); + let params = (&config, &whitelist); + add_benchmarks!(params, batches); + + if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) } + Ok(batches) + } + } +} + +struct CheckInherents; + +impl cumulus_pallet_parachain_system::CheckInherents for CheckInherents { + fn check_inherents( + block: &Block, + relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof, + ) -> sp_inherents::CheckInherentsResult { + let relay_chain_slot = relay_state_proof + .read_slot() + .expect("Could not read the relay chain slot from the proof"); + + let inherent_data = + cumulus_primitives_timestamp::InherentDataProvider::from_relay_chain_slot_and_duration( + relay_chain_slot, + sp_std::time::Duration::from_secs(6), + ) + .create_inherent_data() + .expect("Could not create the timestamp inherent data"); + + inherent_data.check_extrinsics(block) + } +} + +cumulus_pallet_parachain_system::register_validate_block! { + Runtime = Runtime, + BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, + CheckInherents = CheckInherents, +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/block_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/block_weights.rs new file mode 100644 index 00000000000..608a9e346ea --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/block_weights.rs @@ -0,0 +1,52 @@ +// This file is part of Substrate. + +// 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 = constants::WEIGHT_PER_NANOS.saturating_mul(5_000_000); + } + + #[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 >= 100 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 100 µs." + ); + // At most 50 ms. + assert!( + w <= 50 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); + } + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/extrinsic_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/extrinsic_weights.rs new file mode 100644 index 00000000000..74d18830ef8 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/extrinsic_weights.rs @@ -0,0 +1,49 @@ +// This file is part of Substrate. + +// 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 = constants::WEIGHT_PER_NANOS.saturating_mul(125_000); + } + + #[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 >= 10 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); + // At most 1 ms. + assert!(w <= constants::WEIGHT_PER_MILLIS.ref_time(), "Weight should be at most 1 ms."); + } + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs new file mode 100644 index 00000000000..ed0b4dbcd47 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs @@ -0,0 +1,28 @@ +// This file is part of Substrate. + +// 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 extrinsic_weights; +pub mod paritydb_weights; +pub mod rocksdb_weights; + +pub use block_weights::constants::BlockExecutionWeight; +pub use extrinsic_weights::constants::ExtrinsicBaseWeight; +pub use paritydb_weights::constants::ParityDbWeight; +pub use rocksdb_weights::constants::RocksDbWeight; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/paritydb_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/paritydb_weights.rs new file mode 100644 index 00000000000..9131d354509 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/paritydb_weights.rs @@ -0,0 +1,63 @@ +// This file is part of Substrate. + +// 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_PER_NANOS.ref_time(), + write: 50_000 * constants::WEIGHT_PER_NANOS.ref_time(), + }; + } + + #[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) >= constants::WEIGHT_PER_MICROS.ref_time(), + "Read weight should be at least 1 µs." + ); + assert!( + W::get().writes(1) >= constants::WEIGHT_PER_MICROS.ref_time(), + "Write weight should be at least 1 µs." + ); + // At most 1 ms. + assert!( + W::get().reads(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Read weight should be at most 1 ms." + ); + assert!( + W::get().writes(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Write weight should be at most 1 ms." + ); + } + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/rocksdb_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/rocksdb_weights.rs new file mode 100644 index 00000000000..4ced5ec2e2e --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/rocksdb_weights.rs @@ -0,0 +1,63 @@ +// This file is part of Substrate. + +// 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_PER_NANOS.ref_time(), + write: 100_000 * constants::WEIGHT_PER_NANOS.ref_time(), + }; + } + + #[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) >= constants::WEIGHT_PER_MICROS.ref_time(), + "Read weight should be at least 1 µs." + ); + assert!( + W::get().writes(1) >= constants::WEIGHT_PER_MICROS.ref_time(), + "Write weight should be at least 1 µs." + ); + // At most 1 ms. + assert!( + W::get().reads(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Read weight should be at most 1 ms." + ); + assert!( + W::get().writes(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Write weight should be at most 1 ms." + ); + } + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs new file mode 100644 index 00000000000..c608c58b0b8 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -0,0 +1,220 @@ +use super::{ + AccountId, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, + RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, +}; +use core::marker::PhantomData; +use frame_support::{ + log, match_types, parameter_types, + traits::{Everything, Nothing}, +}; +use pallet_xcm::XcmPassthrough; +use polkadot_parachain::primitives::Sibling; +use polkadot_runtime_common::impls::ToAuthor; +use xcm::latest::{prelude::*, Weight as XCMWeight}; +use xcm_builder::{ + AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, + EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + UsingComponents, +}; +use xcm_executor::{traits::ShouldExecute, XcmExecutor}; + +parameter_types! { + pub const RelayLocation: MultiLocation = MultiLocation::parent(); + pub const RelayNetwork: NetworkId = NetworkId::Any; + pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); + pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); +} + +/// Type for specifying how a `MultiLocation` 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 LocalAssetTransactor = CurrencyAdapter< + // 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 MultiLocation 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. + (), +>; + +/// 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 converts to a `Relay` origin when + // recognized. + RelayChainAsNative, + // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when + // recognized. + SiblingParachainAsNative, + // Native signed account converter; this just converts an `AccountId32` origin into a normal + // `Origin::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: u64 = 1_000_000_000; + pub const MaxInstructions: u32 = 100; +} + +match_types! { + pub type ParentOrParentsExecutivePlurality: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } + }; +} + +//TODO: move DenyThenTry to polkadot's xcm module. +/// Deny executing the xcm message if it matches any of the Deny filter regardless of anything else. +/// If it passes the Deny, and matches one of the Allow cases then it is let through. +pub struct DenyThenTry(PhantomData, PhantomData) +where + Deny: ShouldExecute, + Allow: ShouldExecute; + +impl ShouldExecute for DenyThenTry +where + Deny: ShouldExecute, + Allow: ShouldExecute, +{ + fn should_execute( + origin: &MultiLocation, + message: &mut Xcm, + max_weight: XCMWeight, + weight_credit: &mut XCMWeight, + ) -> Result<(), ()> { + Deny::should_execute(origin, message, max_weight, weight_credit)?; + Allow::should_execute(origin, message, max_weight, weight_credit) + } +} + +// See issue #5233 +pub struct DenyReserveTransferToRelayChain; +impl ShouldExecute for DenyReserveTransferToRelayChain { + fn should_execute( + origin: &MultiLocation, + message: &mut Xcm, + _max_weight: XCMWeight, + _weight_credit: &mut XCMWeight, + ) -> Result<(), ()> { + if message.0.iter().any(|inst| { + matches!( + inst, + InitiateReserveWithdraw { + reserve: MultiLocation { parents: 1, interior: Here }, + .. + } | DepositReserveAsset { dest: MultiLocation { parents: 1, interior: Here }, .. } | + TransferReserveAsset { + dest: MultiLocation { parents: 1, interior: Here }, + .. + } + ) + }) { + return Err(()) // Deny + } + + // An unexpected reserve transfer has arrived from the Relay Chain. Generally, `IsReserve` + // should not allow this, but we just log it here. + if matches!(origin, MultiLocation { parents: 1, interior: Here }) && + message.0.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. })) + { + log::warn!( + target: "xcm::barriers", + "Unexpected ReserveAssetDeposited from the Relay Chain", + ); + } + // Permit everything else + Ok(()) + } +} + +pub type Barrier = DenyThenTry< + DenyReserveTransferToRelayChain, + ( + TakeWeightCredit, + AllowTopLevelPaidExecutionFrom, + AllowUnpaidExecutionFrom, + // ^^^ Parent and its exec plurality get free execution + ), +>; + +pub struct XcmConfig; +impl xcm_executor::Config for XcmConfig { + type RuntimeCall = RuntimeCall; + type XcmSender = XcmRouter; + // How to withdraw and deposit an asset. + type AssetTransactor = LocalAssetTransactor; + type OriginConverter = XcmOriginToTransactDispatchOrigin; + type IsReserve = (); + type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of KSM + type LocationInverter = LocationInverter; + type Barrier = Barrier; + type Weigher = FixedWeightBounds; + type Trader = + UsingComponents>; + type ResponseHandler = PolkadotXcm; + type AssetTrap = PolkadotXcm; + type AssetClaims = PolkadotXcm; + type SubscriptionService = PolkadotXcm; +} + +/// No local origins on this chain are allowed to dispatch XCM sends/executions. +pub type LocalOriginToLocation = SignedToAccountId32; + +/// The means for routing XCM messages which are not for local execution into the right message +/// queues. +pub type XcmRouter = ( + // 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 = Nothing; + // ^ Disable dispatchable execute on the XCM pallet. + // Needs to be `Everything` for local testing. + type XcmExecutor = XcmExecutor; + type XcmTeleportFilter = Everything; + type XcmReserveTransferFilter = Nothing; + type Weigher = FixedWeightBounds; + type LocationInverter = LocationInverter; + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + + const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; + // ^ Override for AdvertisedXcmVersion default + type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; +} + +impl cumulus_pallet_xcm::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type XcmExecutor = XcmExecutor; +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 6dbb4d0e4c1..d06022b8634 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -1,4 +1,4 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. +// Copyright 2022 Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs index 4eaa2cba639..608a9e346ea 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::BlockExecutionWeight::get(); // At least 100 µs. - assert!(w >= 100 * constants::WEIGHT_PER_MICROS, "Weight should be at least 100 µs."); + assert!( + w >= 100 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 100 µs." + ); // At most 50 ms. - assert!(w <= 50 * constants::WEIGHT_PER_MILLIS, "Weight should be at most 50 ms."); + assert!( + w <= 50 * constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 50 ms." + ); } } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs index 8083ccb4001..9131d354509 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1) >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1) >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs index 1db87f143f3..4ced5ec2e2e 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS, + W::get().reads(1) >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS, + W::get().writes(1) >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS, + W::get().reads(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS, + W::get().writes(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/polkadot-parachain/Cargo.toml b/polkadot-parachain/Cargo.toml index cfd50043dda..8df8afc4d18 100644 --- a/polkadot-parachain/Cargo.toml +++ b/polkadot-parachain/Cargo.toml @@ -25,6 +25,7 @@ westmint-runtime = { path = "../parachains/runtimes/assets/westmint" } collectives-polkadot-runtime = { path = "../parachains/runtimes/collectives/collectives-polkadot" } contracts-rococo-runtime = { path = "../parachains/runtimes/contracts/contracts-rococo" } bridge-hub-rococo-runtime = { path = "../parachains/runtimes/bridge-hubs/bridge-hub-rococo" } +bridge-hub-kusama-runtime = { path = "../parachains/runtimes/bridge-hubs/bridge-hub-kusama" } penpal-runtime = { path = "../parachains/runtimes/testing/penpal" } jsonrpsee = { version = "0.15.1", features = ["server"] } parachains-common = { path = "../parachains/common" } diff --git a/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/polkadot-parachain/src/chain_spec/bridge_hubs.rs index 93daa8cee9c..cf7df0f0795 100644 --- a/polkadot-parachain/src/chain_spec/bridge_hubs.rs +++ b/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -24,8 +24,11 @@ use std::{path::PathBuf, str::FromStr}; pub enum BridgeHubRuntimeType { Rococo, RococoLocal, + Wococo, WococoLocal, + + Kusama, } impl FromStr for BridgeHubRuntimeType { @@ -33,6 +36,7 @@ impl FromStr for BridgeHubRuntimeType { fn from_str(value: &str) -> Result { match value { + kusama::BRIDGE_HUB_KUSAMA => Ok(BridgeHubRuntimeType::Kusama), rococo::BRIDGE_HUB_ROCOCO => Ok(BridgeHubRuntimeType::Rococo), rococo::BRIDGE_HUB_ROCOCO_LOCAL => Ok(BridgeHubRuntimeType::RococoLocal), wococo::BRIDGE_HUB_WOCOCO => Ok(BridgeHubRuntimeType::Wococo), @@ -46,45 +50,56 @@ impl BridgeHubRuntimeType { pub const ID_PREFIX: &'static str = "bridge-hub"; pub fn chain_spec_from_json_file(&self, path: PathBuf) -> Result, String> { - Ok(Box::new(match self { - BridgeHubRuntimeType::Rococo => rococo::BridgeHubChainSpec::from_json_file(path)?, - BridgeHubRuntimeType::RococoLocal => rococo::BridgeHubChainSpec::from_json_file(path)?, - BridgeHubRuntimeType::Wococo => wococo::BridgeHubChainSpec::from_json_file(path)?, - BridgeHubRuntimeType::WococoLocal => wococo::BridgeHubChainSpec::from_json_file(path)?, - })) + match self { + BridgeHubRuntimeType::Kusama => + Ok(Box::new(kusama::BridgeHubChainSpec::from_json_file(path)?)), + BridgeHubRuntimeType::Rococo => + Ok(Box::new(rococo::BridgeHubChainSpec::from_json_file(path)?)), + BridgeHubRuntimeType::RococoLocal => + Ok(Box::new(rococo::BridgeHubChainSpec::from_json_file(path)?)), + BridgeHubRuntimeType::Wococo => + Ok(Box::new(wococo::BridgeHubChainSpec::from_json_file(path)?)), + BridgeHubRuntimeType::WococoLocal => + Ok(Box::new(wococo::BridgeHubChainSpec::from_json_file(path)?)), + } } - pub fn load_config(&self) -> Box { - Box::new(match self { - BridgeHubRuntimeType::Rococo => rococo::live_config( + pub fn load_config(&self) -> Result, String> { + match self { + BridgeHubRuntimeType::Kusama => + Ok(Box::new(kusama::BridgeHubChainSpec::from_json_bytes( + &include_bytes!("../../../parachains/chain-specs/bridge-hub-kusama.json")[..], + )?)), + BridgeHubRuntimeType::Rococo => Ok(Box::new(rococo::live_config( rococo::BRIDGE_HUB_ROCOCO, "Rococo BrideHub", "rococo", ParaId::new(1013), - ), - BridgeHubRuntimeType::RococoLocal => rococo::local_config( + ))), + BridgeHubRuntimeType::RococoLocal => Ok(Box::new(rococo::local_config( rococo::BRIDGE_HUB_ROCOCO_LOCAL, "Rococo BrideHub Local", "rococo-local", ParaId::new(1013), - ), - BridgeHubRuntimeType::Wococo => wococo::live_config( + ))), + BridgeHubRuntimeType::Wococo => Ok(Box::new(wococo::live_config( wococo::BRIDGE_HUB_WOCOCO, "Wococo BrideHub", "wococo", ParaId::new(1013), - ), - BridgeHubRuntimeType::WococoLocal => wococo::local_config( + ))), + BridgeHubRuntimeType::WococoLocal => Ok(Box::new(wococo::local_config( wococo::BRIDGE_HUB_WOCOCO_LOCAL, "Wococo BrideHub Local", "wococo-local", ParaId::new(1013), - ), - }) + ))), + } } pub fn runtime_version(&self) -> &'static RuntimeVersion { match self { + BridgeHubRuntimeType::Kusama => &bridge_hub_kusama_runtime::VERSION, BridgeHubRuntimeType::Rococo | BridgeHubRuntimeType::Wococo | BridgeHubRuntimeType::RococoLocal | @@ -314,3 +329,15 @@ pub mod wococo { rococo::live_config(id, chain_name, relay_chain, para_id) } } + +/// Sub-module for Kusama setup (reuses stuff from Rococo) +pub mod kusama { + use crate::chain_spec::Extensions; + + pub(crate) const BRIDGE_HUB_KUSAMA: &str = "bridge-hub-kusama"; + + /// Specialized `ChainSpec` for the normal parachain runtime. + pub type BridgeHubChainSpec = + sc_service::GenericChainSpec; + pub type RuntimeApi = bridge_hub_kusama_runtime::RuntimeApi; +} diff --git a/polkadot-parachain/src/command.rs b/polkadot-parachain/src/command.rs index a3be72ec6a8..83e927c036b 100644 --- a/polkadot-parachain/src/command.rs +++ b/polkadot-parachain/src/command.rs @@ -204,7 +204,7 @@ fn load_spec(id: &str) -> std::result::Result, String> { bridge_like_id .parse::() .expect("invalid value") - .load_config(), + .load_config()?, // -- Penpall "penpal-kusama" => Box::new(chain_spec::penpal::get_penpal_chain_spec( @@ -480,23 +480,43 @@ macro_rules! construct_async_run { }) }, Runtime::BridgeHub(bridge_hub_runtime_type) => { - runner.async_run(|$config| { - let $components = match bridge_hub_runtime_type { - chain_spec::bridge_hubs::BridgeHubRuntimeType::Rococo | - chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal => new_partial::( - &$config, - crate::service::aura_build_import_queue::<_, AuraId>, - )?, - chain_spec::bridge_hubs::BridgeHubRuntimeType::Wococo | - chain_spec::bridge_hubs::BridgeHubRuntimeType::WococoLocal => new_partial::( - &$config, - crate::service::aura_build_import_queue::<_, AuraId>, - )?, - }; - - let task_manager = $components.task_manager; - { $( $code )* }.map(|v| (v, task_manager)) - }) + match bridge_hub_runtime_type { + chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama => { + runner.async_run(|$config| { + let $components = new_partial::( + &$config, + crate::service::aura_build_import_queue::<_, AuraId>, + )?; + + let task_manager = $components.task_manager; + { $( $code )* }.map(|v| (v, task_manager)) + }) + }, + chain_spec::bridge_hubs::BridgeHubRuntimeType::Rococo | + chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal => { + runner.async_run(|$config| { + let $components = new_partial::( + &$config, + crate::service::aura_build_import_queue::<_, AuraId>, + )?; + + let task_manager = $components.task_manager; + { $( $code )* }.map(|v| (v, task_manager)) + }) + }, + chain_spec::bridge_hubs::BridgeHubRuntimeType::Wococo | + chain_spec::bridge_hubs::BridgeHubRuntimeType::WococoLocal => { + runner.async_run(|$config| { + let $components = new_partial::( + &$config, + crate::service::aura_build_import_queue::<_, AuraId>, + )?; + + let task_manager = $components.task_manager; + { $( $code )* }.map(|v| (v, task_manager)) + }) + } + } }, Runtime::Penpal(_) | Runtime::Default => { runner.async_run(|$config| { @@ -778,21 +798,30 @@ pub fn run() -> Result<()> { .map(|r| r.0) .map_err(Into::into), Runtime::BridgeHub(bridge_hub_runtime_type) => match bridge_hub_runtime_type { + chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama => + crate::service::start_generic_aura_node::< + chain_spec::bridge_hubs::kusama::RuntimeApi, + AuraId, + >(config, polkadot_config, collator_options, id, hwbench) + .await + .map(|r| r.0), chain_spec::bridge_hubs::BridgeHubRuntimeType::Rococo | chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal => crate::service::start_generic_aura_node::< chain_spec::bridge_hubs::rococo::RuntimeApi, AuraId, - >(config, polkadot_config, collator_options, id, hwbench), + >(config, polkadot_config, collator_options, id, hwbench) + .await + .map(|r| r.0), chain_spec::bridge_hubs::BridgeHubRuntimeType::Wococo | chain_spec::bridge_hubs::BridgeHubRuntimeType::WococoLocal => crate::service::start_generic_aura_node::< chain_spec::bridge_hubs::wococo::RuntimeApi, AuraId, - >(config, polkadot_config, collator_options, id, hwbench), + >(config, polkadot_config, collator_options, id, hwbench) + .await + .map(|r| r.0), } - .await - .map(|r| r.0) .map_err(Into::into), Runtime::Penpal(_) | Runtime::Default => crate::service::start_rococo_parachain_node( From 7ca535b06d61572c07f8a079389b9b994cabaf42 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 15 Nov 2022 10:52:25 +0100 Subject: [PATCH 07/39] Fixes --- .github/workflows/release-30_create-draft.yml | 4 +- .../src/weights/pallet_timestamp.rs | 58 +++++++++++++++++++ .../src/weights/pallet_timestamp.rs | 58 +++++++++++++++++++ 3 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs diff --git a/.github/workflows/release-30_create-draft.yml b/.github/workflows/release-30_create-draft.yml index dcec5bbc2ea..eda2e65a50c 100644 --- a/.github/workflows/release-30_create-draft.yml +++ b/.github/workflows/release-30_create-draft.yml @@ -154,7 +154,7 @@ jobs: WESTMINT_DIGEST: ${{ github.workspace}}/westmint-srtool-json/westmint-srtool-digest.json STATEMINE_DIGEST: ${{ github.workspace}}/statemine-srtool-json/statemine-srtool-digest.json STATEMINT_DIGEST: ${{ github.workspace}}/statemint-srtool-json/statemint-srtool-digest.json - BRIDE_HUB_ROCOCO_DIGEST: ${{ github.workspace}}/bridge-hub-rococo-srtool-json/bridge-hub-rococo-srtool-digest.json + BRIDGE_HUB_ROCOCO_DIGEST: ${{ github.workspace}}/bridge-hub-rococo-srtool-json/bridge-hub-rococo-srtool-digest.json COLLECTIVES_POLKADOT_DIGEST: ${{ github.workspace}}/collectives-polkadot-srtool-json/collectives-polkadot-srtool-digest.json ROCOCO_PARA_DIGEST: ${{ github.workspace}}/rococo-parachain-srtool-json/rococo-parachain-srtool-digest.json CANVAS_KUSAMA_DIGEST: ${{ github.workspace}}/contracts-rococo-srtool-json/contracts-rococo-srtool-digest.json @@ -170,7 +170,7 @@ jobs: ls -al $WESTMINT_DIGEST || true ls -al $STATEMINE_DIGEST || true ls -al $STATEMINT_DIGEST || true - ls -al $BRIDE_HUB_ROCOCO_DIGEST || true + ls -al $BRIDGE_HUB_ROCOCO_DIGEST || true ls -al $COLLECTIVES_POLKADOT_DIGEST || true ls -al $ROCOCO_PARA_DIGEST || true ls -al $CANVAS_KUSAMA_DIGEST || true diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs new file mode 100644 index 00000000000..ec3ef62a08f --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs @@ -0,0 +1,58 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_timestamp` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-07-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=collectives-polkadot-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_timestamp +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_timestamp`. +pub struct WeightInfo(PhantomData); +impl pallet_timestamp::WeightInfo for WeightInfo { + // Storage: Timestamp Now (r:1 w:1) + fn set() -> Weight { + Weight::from_ref_time(6_170_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + fn on_finalize() -> Weight { + Weight::from_ref_time(2_177_000 as u64) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs new file mode 100644 index 00000000000..ec3ef62a08f --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs @@ -0,0 +1,58 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_timestamp` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-07-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=collectives-polkadot-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_timestamp +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_timestamp`. +pub struct WeightInfo(PhantomData); +impl pallet_timestamp::WeightInfo for WeightInfo { + // Storage: Timestamp Now (r:1 w:1) + fn set() -> Weight { + Weight::from_ref_time(6_170_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + fn on_finalize() -> Weight { + Weight::from_ref_time(2_177_000 as u64) + } +} From eb1d7c21938e901c0a5080083955706ed4903cac Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 15 Nov 2022 10:56:05 +0100 Subject: [PATCH 08/39] Fixes for BH --- .../runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs | 10 ++++------ .../bridge-hubs/bridge-hub-kusama/src/weights/mod.rs | 1 + .../bridge-hub-kusama/src/weights/pallet_timestamp.rs | 2 +- .../runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs | 10 ++++------ .../bridge-hubs/bridge-hub-rococo/src/weights/mod.rs | 1 + .../bridge-hub-rococo/src/weights/pallet_timestamp.rs | 2 +- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index 4de1fb99e27..f8d1ce1c7da 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -46,7 +46,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::Everything, + traits::{Everything, ConstU64}, weights::{ConstantMultiplier, Weight}, PalletId, }; @@ -252,16 +252,14 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; } -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; -} +pub const MINIMUM_PERIOD: u64 = SLOT_DURATION / 2; impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; - type WeightInfo = (); + type MinimumPeriod = ConstU64; + type WeightInfo = weights::pallet_timestamp::WeightInfo; } parameter_types! { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs index ed0b4dbcd47..a866e8b324a 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs @@ -20,6 +20,7 @@ pub mod block_weights; pub mod extrinsic_weights; pub mod paritydb_weights; +pub mod pallet_timestamp; pub mod rocksdb_weights; pub use block_weights::constants::BlockExecutionWeight; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs index ec3ef62a08f..cee3e01622f 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright 2022 Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index d06022b8634..b03a0e58091 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -45,7 +45,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::Everything, + traits::{Everything, ConstU64}, weights::{ ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, @@ -289,16 +289,14 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; } -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; -} +pub const MINIMUM_PERIOD: u64 = SLOT_DURATION / 2; impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; - type WeightInfo = (); + type MinimumPeriod = ConstU64; + type WeightInfo = weights::pallet_timestamp::WeightInfo; } parameter_types! { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs index ed0b4dbcd47..a866e8b324a 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs @@ -20,6 +20,7 @@ pub mod block_weights; pub mod extrinsic_weights; pub mod paritydb_weights; +pub mod pallet_timestamp; pub mod rocksdb_weights; pub use block_weights::constants::BlockExecutionWeight; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs index ec3ef62a08f..cee3e01622f 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs @@ -1,4 +1,4 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. +// Copyright 2022 Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify From 4cc421607a4913663bfba175a1fecbf25c8f7eef Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 15 Nov 2022 11:49:37 +0100 Subject: [PATCH 09/39] Fixes for other runtimes - align all --- pallets/collator-selection/src/mock.rs | 8 ++------ parachain-template/runtime/src/lib.rs | 8 ++------ parachains/runtimes/assets/statemine/src/lib.rs | 8 ++------ parachains/runtimes/assets/statemint/src/lib.rs | 8 ++------ parachains/runtimes/assets/westmint/src/lib.rs | 8 ++------ .../runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs | 6 ++---- .../bridge-hubs/bridge-hub-kusama/src/weights/mod.rs | 2 +- .../runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs | 6 ++---- .../bridge-hubs/bridge-hub-rococo/src/weights/mod.rs | 2 +- .../runtimes/collectives/collectives-polkadot/src/lib.rs | 4 +--- parachains/runtimes/testing/penpal/src/lib.rs | 8 ++------ parachains/runtimes/testing/rococo-parachain/src/lib.rs | 8 ++------ test/runtime/src/lib.rs | 8 ++------ 13 files changed, 23 insertions(+), 61 deletions(-) diff --git a/pallets/collator-selection/src/mock.rs b/pallets/collator-selection/src/mock.rs index 4b3cc497731..1845ddbdbf8 100644 --- a/pallets/collator-selection/src/mock.rs +++ b/pallets/collator-selection/src/mock.rs @@ -17,7 +17,7 @@ use super::*; use crate as collator_selection; use frame_support::{ ord_parameter_types, parameter_types, - traits::{FindAuthor, GenesisBuild, ValidatorRegistration}, + traits::{ConstU64, FindAuthor, GenesisBuild, ValidatorRegistration}, PalletId, }; use frame_system as system; @@ -115,14 +115,10 @@ impl pallet_authorship::Config for Test { type EventHandler = CollatorSelection; } -parameter_types! { - pub const MinimumPeriod: u64 = 1; -} - impl pallet_timestamp::Config for Test { type Moment = u64; type OnTimestampSet = Aura; - type MinimumPeriod = MinimumPeriod; + type MinimumPeriod = ConstU64<1>; type WeightInfo = (); } diff --git a/parachain-template/runtime/src/lib.rs b/parachain-template/runtime/src/lib.rs index a52b4982636..f5eeae8a627 100644 --- a/parachain-template/runtime/src/lib.rs +++ b/parachain-template/runtime/src/lib.rs @@ -29,7 +29,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::Everything, + traits::{ConstU64, Everything}, weights::{ constants::WEIGHT_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, @@ -309,15 +309,11 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; } -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; -} - impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; + type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = (); } diff --git a/parachains/runtimes/assets/statemine/src/lib.rs b/parachains/runtimes/assets/statemine/src/lib.rs index 02e51852193..c31a1245535 100644 --- a/parachains/runtimes/assets/statemine/src/lib.rs +++ b/parachains/runtimes/assets/statemine/src/lib.rs @@ -49,7 +49,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{AsEnsureOriginWithArg, EitherOfDiverse, InstanceFilter}, + traits::{AsEnsureOriginWithArg, ConstU64, EitherOfDiverse, InstanceFilter}, weights::{ConstantMultiplier, Weight}, PalletId, RuntimeDebug, }; @@ -167,15 +167,11 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; } -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; -} - impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; + type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = weights::pallet_timestamp::WeightInfo; } diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index f23170f1f15..caf899de7b5 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -78,7 +78,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{AsEnsureOriginWithArg, EitherOfDiverse, InstanceFilter}, + traits::{AsEnsureOriginWithArg, ConstU64, EitherOfDiverse, InstanceFilter}, weights::{ConstantMultiplier, Weight}, PalletId, RuntimeDebug, }; @@ -183,15 +183,11 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; } -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; -} - impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; + type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = weights::pallet_timestamp::WeightInfo; } diff --git a/parachains/runtimes/assets/westmint/src/lib.rs b/parachains/runtimes/assets/westmint/src/lib.rs index 6fc7aa4e621..5e506dde7ea 100644 --- a/parachains/runtimes/assets/westmint/src/lib.rs +++ b/parachains/runtimes/assets/westmint/src/lib.rs @@ -49,7 +49,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{AsEnsureOriginWithArg, InstanceFilter}, + traits::{AsEnsureOriginWithArg, ConstU64, InstanceFilter}, weights::{ConstantMultiplier, Weight}, PalletId, RuntimeDebug, }; @@ -151,15 +151,11 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; } -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; -} - impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; + type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = weights::pallet_timestamp::WeightInfo; } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index f8d1ce1c7da..8da24663315 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -46,7 +46,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{Everything, ConstU64}, + traits::{ConstU64, Everything}, weights::{ConstantMultiplier, Weight}, PalletId, }; @@ -252,13 +252,11 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; } -pub const MINIMUM_PERIOD: u64 = SLOT_DURATION / 2; - impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = ConstU64; + type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = weights::pallet_timestamp::WeightInfo; } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs index a866e8b324a..9ea44cac82c 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs @@ -19,8 +19,8 @@ pub mod block_weights; pub mod extrinsic_weights; -pub mod paritydb_weights; pub mod pallet_timestamp; +pub mod paritydb_weights; pub mod rocksdb_weights; pub use block_weights::constants::BlockExecutionWeight; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index b03a0e58091..295100b0146 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -45,7 +45,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{Everything, ConstU64}, + traits::{ConstU64, Everything}, weights::{ ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, @@ -289,13 +289,11 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; } -pub const MINIMUM_PERIOD: u64 = SLOT_DURATION / 2; - impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = ConstU64; + type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = weights::pallet_timestamp::WeightInfo; } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs index a866e8b324a..9ea44cac82c 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs @@ -19,8 +19,8 @@ pub mod block_weights; pub mod extrinsic_weights; -pub mod paritydb_weights; pub mod pallet_timestamp; +pub mod paritydb_weights; pub mod rocksdb_weights; pub use block_weights::constants::BlockExecutionWeight; diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 1e94ef6c4bc..f0476872a58 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -176,13 +176,11 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; } -pub const MINIMUM_PERIOD: u64 = SLOT_DURATION / 2; - impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = ConstU64; + type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = weights::pallet_timestamp::WeightInfo; } diff --git a/parachains/runtimes/testing/penpal/src/lib.rs b/parachains/runtimes/testing/penpal/src/lib.rs index 6d1df7db967..10a0051bdf9 100644 --- a/parachains/runtimes/testing/penpal/src/lib.rs +++ b/parachains/runtimes/testing/penpal/src/lib.rs @@ -35,7 +35,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{AsEnsureOriginWithArg, Everything}, + traits::{AsEnsureOriginWithArg, ConstU64, Everything}, weights::{ constants::WEIGHT_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, @@ -322,15 +322,11 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; } -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; -} - impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; + type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = (); } diff --git a/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/parachains/runtimes/testing/rococo-parachain/src/lib.rs index e9588870de4..9dad86d4ef7 100644 --- a/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -41,7 +41,7 @@ pub use frame_support::{ construct_runtime, dispatch::DispatchClass, match_types, parameter_types, - traits::{AsEnsureOriginWithArg, EitherOfDiverse, Everything, IsInVec, Randomness}, + traits::{AsEnsureOriginWithArg, ConstU64, EitherOfDiverse, Everything, IsInVec, Randomness}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, ConstantMultiplier, IdentityFee, Weight, @@ -204,15 +204,11 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; } -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; -} - impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; + type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = (); } diff --git a/test/runtime/src/lib.rs b/test/runtime/src/lib.rs index 786590b8b91..5f605234e43 100644 --- a/test/runtime/src/lib.rs +++ b/test/runtime/src/lib.rs @@ -48,7 +48,7 @@ pub use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::Randomness, + traits::{ConstU64, Randomness}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, ConstantMultiplier, IdentityFee, Weight, @@ -209,15 +209,11 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; } -parameter_types! { - pub const MinimumPeriod: u64 = SLOT_DURATION / 2; -} - impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = MinimumPeriod; + type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = (); } From 1821bc9253c7de2dd91001542d700d5d83e1607a Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 15 Nov 2022 12:50:22 +0100 Subject: [PATCH 10/39] Fixes - const --- parachain-template/runtime/src/lib.rs | 17 +--- .../runtimes/assets/statemine/src/lib.rs | 17 +--- .../runtimes/assets/statemint/src/lib.rs | 17 +--- .../runtimes/assets/westmint/src/lib.rs | 17 +--- .../bridge-hubs/bridge-hub-kusama/src/lib.rs | 25 ++--- .../src/weights/frame_system.rs | 90 ++++++++++++++++++ .../bridge-hub-kusama/src/weights/mod.rs | 2 + .../src/weights/pallet_balances.rs | 91 +++++++++++++++++++ .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 25 ++--- .../src/weights/frame_system.rs | 90 ++++++++++++++++++ .../bridge-hub-rococo/src/weights/mod.rs | 2 + .../src/weights/pallet_balances.rs | 91 +++++++++++++++++++ parachains/runtimes/testing/penpal/src/lib.rs | 17 +--- .../testing/rococo-parachain/src/lib.rs | 19 ++-- test/runtime/src/lib.rs | 8 +- 15 files changed, 419 insertions(+), 109 deletions(-) create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/frame_system.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs diff --git a/parachain-template/runtime/src/lib.rs b/parachain-template/runtime/src/lib.rs index f5eeae8a627..2b19c44ec96 100644 --- a/parachain-template/runtime/src/lib.rs +++ b/parachain-template/runtime/src/lib.rs @@ -29,7 +29,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{ConstU64, Everything}, + traits::{ConstU32, ConstU64, ConstU8, Everything}, weights::{ constants::WEIGHT_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, @@ -317,25 +317,19 @@ impl pallet_timestamp::Config for Runtime { type WeightInfo = (); } -parameter_types! { - pub const UncleGenerations: u32 = 0; -} - impl pallet_authorship::Config for Runtime { type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type UncleGenerations = UncleGenerations; + type UncleGenerations = ConstU32<0>; type FilterUncle = (); type EventHandler = (CollatorSelection,); } parameter_types! { pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; - pub const MaxLocks: u32 = 50; - pub const MaxReserves: u32 = 50; } impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; + type MaxLocks = ConstU32<50>; /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. @@ -344,14 +338,13 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = pallet_balances::weights::SubstrateWeight; - type MaxReserves = MaxReserves; + type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; } parameter_types! { /// Relay Chain `TransactionByteFee` / 10 pub const TransactionByteFee: Balance = 10 * MICROUNIT; - pub const OperationalFeeMultiplier: u8 = 5; } impl pallet_transaction_payment::Config for Runtime { @@ -360,7 +353,7 @@ impl pallet_transaction_payment::Config for Runtime { type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; - type OperationalFeeMultiplier = OperationalFeeMultiplier; + type OperationalFeeMultiplier = ConstU8<5>; } parameter_types! { diff --git a/parachains/runtimes/assets/statemine/src/lib.rs b/parachains/runtimes/assets/statemine/src/lib.rs index c31a1245535..8a90d037ab8 100644 --- a/parachains/runtimes/assets/statemine/src/lib.rs +++ b/parachains/runtimes/assets/statemine/src/lib.rs @@ -49,7 +49,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{AsEnsureOriginWithArg, ConstU64, EitherOfDiverse, InstanceFilter}, + traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter}, weights::{ConstantMultiplier, Weight}, PalletId, RuntimeDebug, }; @@ -175,25 +175,19 @@ impl pallet_timestamp::Config for Runtime { type WeightInfo = weights::pallet_timestamp::WeightInfo; } -parameter_types! { - pub const UncleGenerations: u32 = 0; -} - impl pallet_authorship::Config for Runtime { type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type UncleGenerations = UncleGenerations; + type UncleGenerations = ConstU32<0>; type FilterUncle = (); type EventHandler = (CollatorSelection,); } parameter_types! { pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; - pub const MaxLocks: u32 = 50; - pub const MaxReserves: u32 = 50; } impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; + type MaxLocks = ConstU32<50>; /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. @@ -202,14 +196,13 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = weights::pallet_balances::WeightInfo; - type MaxReserves = MaxReserves; + type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; } parameter_types! { /// Relay Chain `TransactionByteFee` / 10 pub const TransactionByteFee: Balance = 1 * MILLICENTS; - pub const OperationalFeeMultiplier: u8 = 5; } impl pallet_transaction_payment::Config for Runtime { @@ -219,7 +212,7 @@ impl pallet_transaction_payment::Config for Runtime { type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; - type OperationalFeeMultiplier = OperationalFeeMultiplier; + type OperationalFeeMultiplier = ConstU8<5>; } parameter_types! { diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index caf899de7b5..65604002969 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -78,7 +78,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{AsEnsureOriginWithArg, ConstU64, EitherOfDiverse, InstanceFilter}, + traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter}, weights::{ConstantMultiplier, Weight}, PalletId, RuntimeDebug, }; @@ -191,25 +191,19 @@ impl pallet_timestamp::Config for Runtime { type WeightInfo = weights::pallet_timestamp::WeightInfo; } -parameter_types! { - pub const UncleGenerations: u32 = 0; -} - impl pallet_authorship::Config for Runtime { type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type UncleGenerations = UncleGenerations; + type UncleGenerations = ConstU32<0>; type FilterUncle = (); type EventHandler = (CollatorSelection,); } parameter_types! { pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; - pub const MaxLocks: u32 = 50; - pub const MaxReserves: u32 = 50; } impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; + type MaxLocks = ConstU32<50>; /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. @@ -218,14 +212,13 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = weights::pallet_balances::WeightInfo; - type MaxReserves = MaxReserves; + type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; } parameter_types! { /// Relay Chain `TransactionByteFee` / 10 pub const TransactionByteFee: Balance = 1 * MILLICENTS; - pub const OperationalFeeMultiplier: u8 = 5; } impl pallet_transaction_payment::Config for Runtime { @@ -235,7 +228,7 @@ impl pallet_transaction_payment::Config for Runtime { type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; - type OperationalFeeMultiplier = OperationalFeeMultiplier; + type OperationalFeeMultiplier = ConstU8<5>; } parameter_types! { diff --git a/parachains/runtimes/assets/westmint/src/lib.rs b/parachains/runtimes/assets/westmint/src/lib.rs index 5e506dde7ea..65306ac60ac 100644 --- a/parachains/runtimes/assets/westmint/src/lib.rs +++ b/parachains/runtimes/assets/westmint/src/lib.rs @@ -49,7 +49,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{AsEnsureOriginWithArg, ConstU64, InstanceFilter}, + traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, InstanceFilter}, weights::{ConstantMultiplier, Weight}, PalletId, RuntimeDebug, }; @@ -159,25 +159,19 @@ impl pallet_timestamp::Config for Runtime { type WeightInfo = weights::pallet_timestamp::WeightInfo; } -parameter_types! { - pub const UncleGenerations: u32 = 0; -} - impl pallet_authorship::Config for Runtime { type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type UncleGenerations = UncleGenerations; + type UncleGenerations = ConstU32<0>; type FilterUncle = (); type EventHandler = (CollatorSelection,); } parameter_types! { pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; - pub const MaxLocks: u32 = 50; - pub const MaxReserves: u32 = 50; } impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; + type MaxLocks = ConstU32<50>; /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. @@ -186,14 +180,13 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = weights::pallet_balances::WeightInfo; - type MaxReserves = MaxReserves; + type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; } parameter_types! { /// Relay Chain `TransactionByteFee` / 10 pub const TransactionByteFee: Balance = 1 * MILLICENTS; - pub const OperationalFeeMultiplier: u8 = 5; } impl pallet_transaction_payment::Config for Runtime { @@ -203,7 +196,7 @@ impl pallet_transaction_payment::Config for Runtime { type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; - type OperationalFeeMultiplier = OperationalFeeMultiplier; + type OperationalFeeMultiplier = ConstU8<5>; } parameter_types! { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index 8da24663315..b3a30d4b615 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -46,7 +46,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{ConstU64, Everything}, + traits::{ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything}, weights::{ConstantMultiplier, Weight}, PalletId, }; @@ -240,7 +240,7 @@ impl frame_system::Config for Runtime { /// The basic call filter to use in dispatchable. type BaseCallFilter = Everything; /// Weight information for the extrinsics of this pallet. - type SystemWeightInfo = (); + type SystemWeightInfo = weights::frame_system::WeightInfo; /// Block & extrinsics weights: base values and limits. type BlockWeights = RuntimeBlockWeights; /// The maximum length of a block (in bytes). @@ -249,7 +249,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; - type MaxConsumers = frame_support::traits::ConstU32<16>; + type MaxConsumers = ConstU32<16>; } impl pallet_timestamp::Config for Runtime { @@ -260,50 +260,43 @@ impl pallet_timestamp::Config for Runtime { type WeightInfo = weights::pallet_timestamp::WeightInfo; } -parameter_types! { - pub const UncleGenerations: u32 = 0; -} - impl pallet_authorship::Config for Runtime { type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type UncleGenerations = UncleGenerations; + type UncleGenerations = ConstU32<0>; type FilterUncle = (); type EventHandler = (CollatorSelection,); } parameter_types! { pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; - pub const MaxLocks: u32 = 50; - pub const MaxReserves: u32 = 50; } impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; /// The type for recording an account's balance. type Balance = Balance; + type DustRemoval = (); /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = pallet_balances::weights::SubstrateWeight; - type MaxReserves = MaxReserves; + type WeightInfo = weights::pallet_balances::WeightInfo; + type MaxLocks = ConstU32<50>; + type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; } parameter_types! { /// Relay Chain `TransactionByteFee` / 10 pub const TransactionByteFee: Balance = 1 * MILLICENTS; - pub const OperationalFeeMultiplier: u8 = 5; } impl pallet_transaction_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; + type OperationalFeeMultiplier = ConstU8<5>; type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; - type OperationalFeeMultiplier = OperationalFeeMultiplier; } parameter_types! { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/frame_system.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/frame_system.rs new file mode 100644 index 00000000000..d871fc7021f --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/frame_system.rs @@ -0,0 +1,90 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `frame_system` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=statemine-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=frame_system +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/statemine/src/weights/frame_system.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight}}; +use sp_std::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 { + Weight::from_ref_time(0 as u64) + } + /// The range of component `b` is `[0, 3932160]`. + fn remark_with_event(b: u32, ) -> Weight { + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) + } + // Storage: System Digest (r:1 w:1) + // Storage: unknown [0x3a686561707061676573] (r:0 w:1) + fn set_heap_pages() -> Weight { + Weight::from_ref_time(8_677_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: Skipped Metadata (r:0 w:0) + /// The range of component `i` is `[1, 1000]`. + fn set_storage(i: u32, ) -> Weight { + Weight::from_ref_time(0 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(625_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) + } + // Storage: Skipped Metadata (r:0 w:0) + /// The range of component `i` is `[1, 1000]`. + fn kill_storage(i: u32, ) -> Weight { + Weight::from_ref_time(0 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(554_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) + } + // Storage: Skipped Metadata (r:0 w:0) + /// The range of component `p` is `[1, 1000]`. + fn kill_prefix(p: u32, ) -> Weight { + Weight::from_ref_time(0 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(1_128_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(p as u64))) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs index 9ea44cac82c..8db278185c8 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs @@ -19,7 +19,9 @@ pub mod block_weights; pub mod extrinsic_weights; +pub mod frame_system; pub mod pallet_timestamp; +pub mod pallet_balances; pub mod paritydb_weights; pub mod rocksdb_weights; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs new file mode 100644 index 00000000000..8d28cb51805 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs @@ -0,0 +1,91 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_balances` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=statemine-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_balances +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_balances.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_balances`. +pub struct WeightInfo(PhantomData); +impl pallet_balances::WeightInfo for WeightInfo { + // Storage: System Account (r:1 w:1) + fn transfer() -> Weight { + Weight::from_ref_time(46_411_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:1 w:1) + fn transfer_keep_alive() -> Weight { + Weight::from_ref_time(34_589_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:1 w:1) + fn set_balance_creating() -> Weight { + Weight::from_ref_time(25_591_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:1 w:1) + fn set_balance_killing() -> Weight { + Weight::from_ref_time(29_471_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:2 w:2) + fn force_transfer() -> Weight { + Weight::from_ref_time(46_550_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: System Account (r:1 w:1) + fn transfer_all() -> Weight { + Weight::from_ref_time(40_804_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:1 w:1) + fn force_unreserve() -> Weight { + Weight::from_ref_time(22_516_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 295100b0146..9772bf37d67 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -45,7 +45,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{ConstU64, Everything}, + traits::{ConstU32, ConstU64, ConstU8, Everything}, weights::{ ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, @@ -277,7 +277,7 @@ impl frame_system::Config for Runtime { /// The basic call filter to use in dispatchable. type BaseCallFilter = Everything; /// Weight information for the extrinsics of this pallet. - type SystemWeightInfo = (); + type SystemWeightInfo = weights::frame_system::WeightInfo; /// Block & extrinsics weights: base values and limits. type BlockWeights = RuntimeBlockWeights; /// The maximum length of a block (in bytes). @@ -286,7 +286,7 @@ impl frame_system::Config for Runtime { type SS58Prefix = SS58Prefix; /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; - type MaxConsumers = frame_support::traits::ConstU32<16>; + type MaxConsumers = ConstU32<16>; } impl pallet_timestamp::Config for Runtime { @@ -297,50 +297,43 @@ impl pallet_timestamp::Config for Runtime { type WeightInfo = weights::pallet_timestamp::WeightInfo; } -parameter_types! { - pub const UncleGenerations: u32 = 0; -} - impl pallet_authorship::Config for Runtime { type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type UncleGenerations = UncleGenerations; + type UncleGenerations = ConstU32<0>; type FilterUncle = (); type EventHandler = (CollatorSelection,); } parameter_types! { pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; - pub const MaxLocks: u32 = 50; - pub const MaxReserves: u32 = 50; } impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; /// The type for recording an account's balance. type Balance = Balance; + type DustRemoval = (); /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = pallet_balances::weights::SubstrateWeight; - type MaxReserves = MaxReserves; + type WeightInfo = weights::pallet_balances::WeightInfo; + type MaxLocks = ConstU32<50>; + type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; } parameter_types! { /// Relay Chain `TransactionByteFee` / 10 pub const TransactionByteFee: Balance = 10 * MICROUNIT; - pub const OperationalFeeMultiplier: u8 = 5; } impl pallet_transaction_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; + type OperationalFeeMultiplier = ConstU8<5>; type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; - type OperationalFeeMultiplier = OperationalFeeMultiplier; } parameter_types! { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system.rs new file mode 100644 index 00000000000..d871fc7021f --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system.rs @@ -0,0 +1,90 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `frame_system` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=statemine-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=frame_system +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/statemine/src/weights/frame_system.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight}}; +use sp_std::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 { + Weight::from_ref_time(0 as u64) + } + /// The range of component `b` is `[0, 3932160]`. + fn remark_with_event(b: u32, ) -> Weight { + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) + } + // Storage: System Digest (r:1 w:1) + // Storage: unknown [0x3a686561707061676573] (r:0 w:1) + fn set_heap_pages() -> Weight { + Weight::from_ref_time(8_677_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: Skipped Metadata (r:0 w:0) + /// The range of component `i` is `[1, 1000]`. + fn set_storage(i: u32, ) -> Weight { + Weight::from_ref_time(0 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(625_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) + } + // Storage: Skipped Metadata (r:0 w:0) + /// The range of component `i` is `[1, 1000]`. + fn kill_storage(i: u32, ) -> Weight { + Weight::from_ref_time(0 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(554_000 as u64).saturating_mul(i as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) + } + // Storage: Skipped Metadata (r:0 w:0) + /// The range of component `p` is `[1, 1000]`. + fn kill_prefix(p: u32, ) -> Weight { + Weight::from_ref_time(0 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(1_128_000 as u64).saturating_mul(p as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(p as u64))) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs index 9ea44cac82c..84222f0ac7e 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs @@ -19,6 +19,8 @@ pub mod block_weights; pub mod extrinsic_weights; +pub mod frame_system; +pub mod pallet_balances; pub mod pallet_timestamp; pub mod paritydb_weights; pub mod rocksdb_weights; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs new file mode 100644 index 00000000000..8d28cb51805 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs @@ -0,0 +1,91 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_balances` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=statemine-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_balances +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_balances.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_balances`. +pub struct WeightInfo(PhantomData); +impl pallet_balances::WeightInfo for WeightInfo { + // Storage: System Account (r:1 w:1) + fn transfer() -> Weight { + Weight::from_ref_time(46_411_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:1 w:1) + fn transfer_keep_alive() -> Weight { + Weight::from_ref_time(34_589_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:1 w:1) + fn set_balance_creating() -> Weight { + Weight::from_ref_time(25_591_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:1 w:1) + fn set_balance_killing() -> Weight { + Weight::from_ref_time(29_471_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:2 w:2) + fn force_transfer() -> Weight { + Weight::from_ref_time(46_550_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: System Account (r:1 w:1) + fn transfer_all() -> Weight { + Weight::from_ref_time(40_804_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: System Account (r:1 w:1) + fn force_unreserve() -> Weight { + Weight::from_ref_time(22_516_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } +} diff --git a/parachains/runtimes/testing/penpal/src/lib.rs b/parachains/runtimes/testing/penpal/src/lib.rs index 10a0051bdf9..f439df48b1c 100644 --- a/parachains/runtimes/testing/penpal/src/lib.rs +++ b/parachains/runtimes/testing/penpal/src/lib.rs @@ -35,7 +35,7 @@ use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{AsEnsureOriginWithArg, ConstU64, Everything}, + traits::{AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, Everything}, weights::{ constants::WEIGHT_PER_SECOND, ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, @@ -330,25 +330,19 @@ impl pallet_timestamp::Config for Runtime { type WeightInfo = (); } -parameter_types! { - pub const UncleGenerations: u32 = 0; -} - impl pallet_authorship::Config for Runtime { type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type UncleGenerations = UncleGenerations; + type UncleGenerations = ConstU32<0>; type FilterUncle = (); type EventHandler = (CollatorSelection,); } parameter_types! { pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT; - pub const MaxLocks: u32 = 50; - pub const MaxReserves: u32 = 50; } impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; + type MaxLocks = ConstU32<50>; /// The type for recording an account's balance. type Balance = Balance; /// The ubiquitous event type. @@ -357,14 +351,13 @@ impl pallet_balances::Config for Runtime { type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = pallet_balances::weights::SubstrateWeight; - type MaxReserves = MaxReserves; + type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; } parameter_types! { /// Relay Chain `TransactionByteFee` / 10 pub const TransactionByteFee: Balance = 10 * MICROUNIT; - pub const OperationalFeeMultiplier: u8 = 5; } impl pallet_transaction_payment::Config for Runtime { @@ -373,7 +366,7 @@ impl pallet_transaction_payment::Config for Runtime { type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; - type OperationalFeeMultiplier = OperationalFeeMultiplier; + type OperationalFeeMultiplier = ConstU8<5>; } parameter_types! { diff --git a/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/parachains/runtimes/testing/rococo-parachain/src/lib.rs index 9dad86d4ef7..083f41d46ef 100644 --- a/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -41,7 +41,10 @@ pub use frame_support::{ construct_runtime, dispatch::DispatchClass, match_types, parameter_types, - traits::{AsEnsureOriginWithArg, ConstU64, EitherOfDiverse, Everything, IsInVec, Randomness}, + traits::{ + AsEnsureOriginWithArg, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything, IsInVec, + Randomness, + }, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, ConstantMultiplier, IdentityFee, Weight, @@ -217,35 +220,29 @@ parameter_types! { pub const TransferFee: u128 = 1 * MILLIROC; pub const CreationFee: u128 = 1 * MILLIROC; pub const TransactionByteFee: u128 = 1 * MICROROC; - pub const MaxLocks: u32 = 50; - pub const MaxReserves: u32 = 50; } 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 DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; type WeightInfo = (); - type MaxLocks = MaxLocks; - type MaxReserves = MaxReserves; + type MaxLocks = ConstU32<50>; + type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; } -parameter_types! { - pub const OperationalFeeMultiplier: u8 = 5; -} - impl pallet_transaction_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type WeightToFee = IdentityFee; type LengthToFee = ConstantMultiplier; type FeeMultiplierUpdate = (); - type OperationalFeeMultiplier = OperationalFeeMultiplier; + type OperationalFeeMultiplier = ConstU8<5>; } impl pallet_sudo::Config for Runtime { diff --git a/test/runtime/src/lib.rs b/test/runtime/src/lib.rs index 5f605234e43..45bebbbcdd4 100644 --- a/test/runtime/src/lib.rs +++ b/test/runtime/src/lib.rs @@ -48,7 +48,7 @@ pub use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{ConstU64, Randomness}, + traits::{ConstU64, ConstU8, Randomness}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, ConstantMultiplier, IdentityFee, Weight, @@ -239,17 +239,13 @@ impl pallet_balances::Config for Runtime { type ReserveIdentifier = [u8; 8]; } -parameter_types! { - pub const OperationalFeeMultiplier: u8 = 5; -} - impl pallet_transaction_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; type WeightToFee = IdentityFee; type LengthToFee = ConstantMultiplier; type FeeMultiplierUpdate = (); - type OperationalFeeMultiplier = OperationalFeeMultiplier; + type OperationalFeeMultiplier = ConstU8<5>; } impl pallet_sudo::Config for Runtime { From 5475227e192e1b1e55cf7178781179cdcd8f5d05 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 15 Nov 2022 13:22:45 +0100 Subject: [PATCH 11/39] Fixes const --- pallets/collator-selection/src/mock.rs | 5 +- parachain-template/runtime/src/lib.rs | 3 +- .../runtimes/assets/statemine/src/lib.rs | 3 +- .../runtimes/assets/statemint/src/lib.rs | 3 +- .../runtimes/assets/westmint/src/lib.rs | 3 +- .../bridge-hubs/bridge-hub-kusama/src/lib.rs | 46 +++---- .../src/weights/cumulus_pallet_xcmp_queue.rs | 61 +++++++++ .../bridge-hub-kusama/src/weights/mod.rs | 5 +- .../src/weights/pallet_collator_selection.rs | 118 ++++++++++++++++++ .../src/weights/pallet_session.rs | 63 ++++++++++ .../bridge-hub-kusama/src/xcm_config.rs | 16 ++- .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 33 ++--- .../src/weights/cumulus_pallet_xcmp_queue.rs | 61 +++++++++ .../bridge-hub-rococo/src/weights/mod.rs | 3 + .../src/weights/pallet_collator_selection.rs | 118 ++++++++++++++++++ .../src/weights/pallet_session.rs | 63 ++++++++++ .../bridge-hub-rococo/src/xcm_config.rs | 10 +- parachains/runtimes/testing/penpal/src/lib.rs | 3 +- .../testing/rococo-parachain/src/lib.rs | 3 +- 19 files changed, 553 insertions(+), 67 deletions(-) create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs diff --git a/pallets/collator-selection/src/mock.rs b/pallets/collator-selection/src/mock.rs index 1845ddbdbf8..baa4655cce6 100644 --- a/pallets/collator-selection/src/mock.rs +++ b/pallets/collator-selection/src/mock.rs @@ -17,7 +17,7 @@ use super::*; use crate as collator_selection; use frame_support::{ ord_parameter_types, parameter_types, - traits::{ConstU64, FindAuthor, GenesisBuild, ValidatorRegistration}, + traits::{ConstU32, ConstU64, FindAuthor, GenesisBuild, ValidatorRegistration}, PalletId, }; use frame_system as system; @@ -124,7 +124,7 @@ impl pallet_timestamp::Config for Test { impl pallet_aura::Config for Test { type AuthorityId = sp_consensus_aura::sr25519::AuthorityId; - type MaxAuthorities = MaxAuthorities; + type MaxAuthorities = ConstU32<100_000>; type DisabledValidators = (); } @@ -188,7 +188,6 @@ parameter_types! { pub const MaxCandidates: u32 = 20; pub const MaxInvulnerables: u32 = 20; pub const MinCandidates: u32 = 1; - pub const MaxAuthorities: u32 = 100_000; } pub struct IsRegistered; diff --git a/parachain-template/runtime/src/lib.rs b/parachain-template/runtime/src/lib.rs index 2b19c44ec96..62581581dc9 100644 --- a/parachain-template/runtime/src/lib.rs +++ b/parachain-template/runtime/src/lib.rs @@ -397,7 +397,6 @@ impl cumulus_pallet_dmp_queue::Config for Runtime { parameter_types! { pub const Period: u32 = 6 * HOURS; pub const Offset: u32 = 0; - pub const MaxAuthorities: u32 = 100_000; } impl pallet_session::Config for Runtime { @@ -417,7 +416,7 @@ impl pallet_session::Config for Runtime { impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; + type MaxAuthorities = ConstU32<100_000>; } parameter_types! { diff --git a/parachains/runtimes/assets/statemine/src/lib.rs b/parachains/runtimes/assets/statemine/src/lib.rs index 8a90d037ab8..edb4e059d6a 100644 --- a/parachains/runtimes/assets/statemine/src/lib.rs +++ b/parachains/runtimes/assets/statemine/src/lib.rs @@ -466,7 +466,6 @@ impl cumulus_pallet_dmp_queue::Config for Runtime { parameter_types! { pub const Period: u32 = 6 * HOURS; pub const Offset: u32 = 0; - pub const MaxAuthorities: u32 = 100_000; } impl pallet_session::Config for Runtime { @@ -486,7 +485,7 @@ impl pallet_session::Config for Runtime { impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; + type MaxAuthorities = ConstU32<100_000>; } parameter_types! { diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index 65604002969..71a252e51a2 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -482,7 +482,6 @@ impl cumulus_pallet_dmp_queue::Config for Runtime { parameter_types! { pub const Period: u32 = 6 * HOURS; pub const Offset: u32 = 0; - pub const MaxAuthorities: u32 = 100_000; } impl pallet_session::Config for Runtime { @@ -502,7 +501,7 @@ impl pallet_session::Config for Runtime { impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; + type MaxAuthorities = ConstU32<100_000>; } parameter_types! { diff --git a/parachains/runtimes/assets/westmint/src/lib.rs b/parachains/runtimes/assets/westmint/src/lib.rs index 65306ac60ac..1dd96788dc8 100644 --- a/parachains/runtimes/assets/westmint/src/lib.rs +++ b/parachains/runtimes/assets/westmint/src/lib.rs @@ -444,7 +444,6 @@ impl cumulus_pallet_dmp_queue::Config for Runtime { parameter_types! { pub const Period: u32 = 6 * HOURS; pub const Offset: u32 = 0; - pub const MaxAuthorities: u32 = 100_000; } impl pallet_session::Config for Runtime { @@ -464,7 +463,7 @@ impl pallet_session::Config for Runtime { impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; + type MaxAuthorities = ConstU32<100_000>; } parameter_types! { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index b3a30d4b615..3629d96125a 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -54,6 +54,7 @@ use frame_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; +use pallet_xcm::{EnsureXcm, IsMajorityOfBody}; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; pub use sp_runtime::{MultiAddress, Perbill, Permill}; use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin}; @@ -67,6 +68,7 @@ use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; // XCM Imports +use crate::xcm_config::KsmRelayLocation; use parachains_common::{ AccountId, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, @@ -320,15 +322,21 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} +/// Privileged origin that represents Root or the majority of the Relay Chain Council. +pub type RootOrExecutiveSimpleMajority = EitherOfDiverse< + EnsureRoot, + EnsureXcm>, +>; + impl cumulus_pallet_xcmp_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; - type VersionWrapper = (); + type VersionWrapper = PolkadotXcm; type ExecuteOverweightOrigin = EnsureRoot; - type ControllerOrigin = EnsureRoot; + type ControllerOrigin = RootOrExecutiveSimpleMajority; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; - type WeightInfo = (); + type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; } impl cumulus_pallet_dmp_queue::Config for Runtime { @@ -337,58 +345,52 @@ impl cumulus_pallet_dmp_queue::Config for Runtime { type ExecuteOverweightOrigin = EnsureRoot; } -parameter_types! { - pub const Period: u32 = 6 * HOURS; - pub const Offset: u32 = 0; - pub const MaxAuthorities: u32 = 100_000; -} +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; - type NextSessionRotation = pallet_session::PeriodicSessions; + type ShouldEndSession = pallet_session::PeriodicSessions, ConstU32>; + type NextSessionRotation = pallet_session::PeriodicSessions, ConstU32>; type SessionManager = CollatorSelection; // Essentially just Aura, but lets be pedantic. type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; - type WeightInfo = (); + type WeightInfo = weights::pallet_session::WeightInfo; } impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; + type MaxAuthorities = ConstU32<100_000>; } parameter_types! { pub const PotId: PalletId = PalletId(*b"PotStake"); - pub const MaxCandidates: u32 = 1000; - pub const MinCandidates: u32 = 5; pub const SessionLength: BlockNumber = 6 * HOURS; - pub const MaxInvulnerables: u32 = 100; pub const ExecutiveBody: BodyId = BodyId::Executive; } -// We allow root only to execute privileged collator selection operations. -pub type CollatorSelectionUpdateOrigin = EnsureRoot; +/// We allow root and the Relay Chain council to execute privileged collator selection operations. +pub type CollatorSelectionUpdateOrigin = RootOrExecutiveSimpleMajority; impl pallet_collator_selection::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; - type MaxCandidates = MaxCandidates; - type MinCandidates = MinCandidates; - type MaxInvulnerables = MaxInvulnerables; + type MaxCandidates = ConstU32<1000>; + type MinCandidates = ConstU32<5>; + type MaxInvulnerables = ConstU32<100>; // should be a multiple of session or things will get inconsistent - type KickThreshold = Period; + type KickThreshold = ConstU32; type ValidatorId = ::AccountId; type ValidatorIdOf = pallet_collator_selection::IdentityCollator; type ValidatorRegistration = Session; - type WeightInfo = (); + type WeightInfo = weights::pallet_collator_selection::WeightInfo; } // Create the runtime by composing the FRAME pallets that were previously configured. diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs new file mode 100644 index 00000000000..16a431d8b18 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs @@ -0,0 +1,61 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `cumulus_pallet_xcmp_queue` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-08-09, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=statemine-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=cumulus_pallet_xcmp_queue +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/statemine/src/weights + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::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) + fn set_config_with_u32() -> Weight { + Weight::from_ref_time(5_634_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: XcmpQueue QueueConfig (r:1 w:1) + fn set_config_with_weight() -> Weight { + Weight::from_ref_time(5_559_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs index 8db278185c8..a1b84aed399 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs @@ -18,10 +18,13 @@ //! Expose the auto generated weight files. pub mod block_weights; +pub mod cumulus_pallet_xcmp_queue; pub mod extrinsic_weights; pub mod frame_system; -pub mod pallet_timestamp; pub mod pallet_balances; +pub mod pallet_collator_selection; +pub mod pallet_session; +pub mod pallet_timestamp; pub mod paritydb_weights; pub mod rocksdb_weights; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs new file mode 100644 index 00000000000..53d31d9fa2c --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs @@ -0,0 +1,118 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_collator_selection` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=statemine-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_collator_selection +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_collator_selection.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_collator_selection`. +pub struct WeightInfo(PhantomData); +impl pallet_collator_selection::WeightInfo for WeightInfo { + // Storage: Session NextKeys (r:1 w:0) + // Storage: CollatorSelection Invulnerables (r:0 w:1) + /// The range of component `b` is `[1, 100]`. + fn set_invulnerables(b: u32, ) -> Weight { + Weight::from_ref_time(23_858_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(2_412_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: CollatorSelection DesiredCandidates (r:0 w:1) + fn set_desired_candidates() -> Weight { + Weight::from_ref_time(14_642_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: CollatorSelection CandidacyBond (r:0 w:1) + fn set_candidacy_bond() -> Weight { + Weight::from_ref_time(14_842_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: CollatorSelection Candidates (r:1 w:1) + // Storage: CollatorSelection DesiredCandidates (r:1 w:0) + // Storage: CollatorSelection Invulnerables (r:1 w:0) + // Storage: Session NextKeys (r:1 w:0) + // Storage: CollatorSelection CandidacyBond (r:1 w:0) + // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + /// The range of component `c` is `[1, 1000]`. + fn register_as_candidate(c: u32, ) -> Weight { + Weight::from_ref_time(61_940_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(170_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: CollatorSelection Candidates (r:1 w:1) + // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + /// The range of component `c` is `[6, 1000]`. + fn leave_intent(c: u32, ) -> Weight { + Weight::from_ref_time(60_018_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(162_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: System Account (r:2 w:2) + // Storage: System BlockWeight (r:1 w:1) + // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + fn note_author() -> Weight { + Weight::from_ref_time(35_100_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + } + // Storage: CollatorSelection Candidates (r:1 w:1) + // Storage: CollatorSelection LastAuthoredBlock (r:1000 w:1) + // Storage: System Account (r:1 w:1) + // Storage: CollatorSelection Invulnerables (r:1 w:0) + // Storage: System BlockWeight (r:1 w:1) + /// The range of component `r` is `[1, 1000]`. + /// The range of component `c` is `[1, 1000]`. + fn new_session(r: u32, c: u32, ) -> Weight { + Weight::from_ref_time(0 as u64) + // Standard Error: 1_237_000 + .saturating_add(Weight::from_ref_time(6_686_000 as u64).saturating_mul(r as u64)) + // Standard Error: 1_237_000 + .saturating_add(Weight::from_ref_time(32_537_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(c as u64))) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs new file mode 100644 index 00000000000..0948531fc0e --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs @@ -0,0 +1,63 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_session` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=statemine-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_session +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_session.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_session`. +pub struct WeightInfo(PhantomData); +impl pallet_session::WeightInfo for WeightInfo { + // Storage: Session NextKeys (r:1 w:1) + // Storage: Session KeyOwner (r:1 w:1) + fn set_keys() -> Weight { + Weight::from_ref_time(23_807_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: Session NextKeys (r:1 w:1) + // Storage: Session KeyOwner (r:0 w:1) + fn purge_keys() -> Weight { + Weight::from_ref_time(20_676_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index c608c58b0b8..71766a8b793 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -8,12 +8,13 @@ use frame_support::{ traits::{Everything, Nothing}, }; use pallet_xcm::XcmPassthrough; +use parachains_common::xcm_config::ConcreteNativeAssetFrom; use polkadot_parachain::primitives::Sibling; use polkadot_runtime_common::impls::ToAuthor; use xcm::latest::{prelude::*, Weight as XCMWeight}; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, - EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset, ParentIsPreset, + EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, @@ -21,8 +22,8 @@ use xcm_builder::{ use xcm_executor::{traits::ShouldExecute, XcmExecutor}; parameter_types! { - pub const RelayLocation: MultiLocation = MultiLocation::parent(); - pub const RelayNetwork: NetworkId = NetworkId::Any; + pub const KsmRelayLocation: MultiLocation = MultiLocation::parent(); + pub const RelayNetwork: NetworkId = NetworkId::Kusama; pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); } @@ -44,7 +45,7 @@ pub type LocalAssetTransactor = CurrencyAdapter< // Use this currency: Balances, // Use this currency when it is a fungible asset matching the given location or name: - IsConcrete, + IsConcrete, // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): @@ -168,13 +169,16 @@ impl xcm_executor::Config for XcmConfig { // How to withdraw and deposit an asset. type AssetTransactor = LocalAssetTransactor; type OriginConverter = XcmOriginToTransactDispatchOrigin; + // BridgeHub does not recognize a reserve location for any asset. Users must teleport KSM + // where allowed (e.g. with the Relay Chain). type IsReserve = (); - type IsTeleporter = NativeAsset; // <- should be enough to allow teleportation of KSM + /// Only allow teleportation of KSM. + type IsTeleporter = ConcreteNativeAssetFrom; type LocationInverter = LocationInverter; type Barrier = Barrier; type Weigher = FixedWeightBounds; type Trader = - UsingComponents>; + UsingComponents>; type ResponseHandler = PolkadotXcm; type AssetTrap = PolkadotXcm; type AssetClaims = PolkadotXcm; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 9772bf37d67..20d43cdaca7 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -361,11 +361,11 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; - type VersionWrapper = (); + type VersionWrapper = PolkadotXcm; type ExecuteOverweightOrigin = EnsureRoot; type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; - type WeightInfo = (); + type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo; } impl cumulus_pallet_dmp_queue::Config for Runtime { @@ -374,42 +374,35 @@ impl cumulus_pallet_dmp_queue::Config for Runtime { type ExecuteOverweightOrigin = EnsureRoot; } -parameter_types! { - pub const Period: u32 = 6 * HOURS; - pub const Offset: u32 = 0; - pub const MaxAuthorities: u32 = 100_000; -} +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; - type NextSessionRotation = pallet_session::PeriodicSessions; + type ShouldEndSession = pallet_session::PeriodicSessions, ConstU32>; + type NextSessionRotation = pallet_session::PeriodicSessions, ConstU32>; type SessionManager = CollatorSelection; // Essentially just Aura, but lets be pedantic. type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; - type WeightInfo = (); + type WeightInfo = weights::pallet_session::WeightInfo; } impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; + type MaxAuthorities = ConstU32<100_000>; } parameter_types! { pub const PotId: PalletId = PalletId(*b"PotStake"); - pub const MaxCandidates: u32 = 1000; - pub const MinCandidates: u32 = 5; pub const SessionLength: BlockNumber = 6 * HOURS; - pub const MaxInvulnerables: u32 = 100; pub const ExecutiveBody: BodyId = BodyId::Executive; } -// We allow root only to execute privileged collator selection operations. pub type CollatorSelectionUpdateOrigin = EnsureRoot; impl pallet_collator_selection::Config for Runtime { @@ -417,15 +410,15 @@ impl pallet_collator_selection::Config for Runtime { type Currency = Balances; type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; - type MaxCandidates = MaxCandidates; - type MinCandidates = MinCandidates; - type MaxInvulnerables = MaxInvulnerables; + type MaxCandidates = ConstU32<1000>; + type MinCandidates = ConstU32<5>; + type MaxInvulnerables = ConstU32<100>; // should be a multiple of session or things will get inconsistent - type KickThreshold = Period; + type KickThreshold = ConstU32; type ValidatorId = ::AccountId; type ValidatorIdOf = pallet_collator_selection::IdentityCollator; type ValidatorRegistration = Session; - type WeightInfo = (); + type WeightInfo = weights::pallet_collator_selection::WeightInfo; } // Create the runtime by composing the FRAME pallets that were previously configured. diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs new file mode 100644 index 00000000000..16a431d8b18 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs @@ -0,0 +1,61 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `cumulus_pallet_xcmp_queue` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-08-09, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=statemine-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=cumulus_pallet_xcmp_queue +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/statemine/src/weights + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::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) + fn set_config_with_u32() -> Weight { + Weight::from_ref_time(5_634_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: XcmpQueue QueueConfig (r:1 w:1) + fn set_config_with_weight() -> Weight { + Weight::from_ref_time(5_559_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs index 84222f0ac7e..a1b84aed399 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs @@ -18,9 +18,12 @@ //! Expose the auto generated weight files. pub mod block_weights; +pub mod cumulus_pallet_xcmp_queue; pub mod extrinsic_weights; pub mod frame_system; pub mod pallet_balances; +pub mod pallet_collator_selection; +pub mod pallet_session; pub mod pallet_timestamp; pub mod paritydb_weights; pub mod rocksdb_weights; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs new file mode 100644 index 00000000000..53d31d9fa2c --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs @@ -0,0 +1,118 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_collator_selection` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=statemine-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_collator_selection +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_collator_selection.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_collator_selection`. +pub struct WeightInfo(PhantomData); +impl pallet_collator_selection::WeightInfo for WeightInfo { + // Storage: Session NextKeys (r:1 w:0) + // Storage: CollatorSelection Invulnerables (r:0 w:1) + /// The range of component `b` is `[1, 100]`. + fn set_invulnerables(b: u32, ) -> Weight { + Weight::from_ref_time(23_858_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(2_412_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: CollatorSelection DesiredCandidates (r:0 w:1) + fn set_desired_candidates() -> Weight { + Weight::from_ref_time(14_642_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: CollatorSelection CandidacyBond (r:0 w:1) + fn set_candidacy_bond() -> Weight { + Weight::from_ref_time(14_842_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: CollatorSelection Candidates (r:1 w:1) + // Storage: CollatorSelection DesiredCandidates (r:1 w:0) + // Storage: CollatorSelection Invulnerables (r:1 w:0) + // Storage: Session NextKeys (r:1 w:0) + // Storage: CollatorSelection CandidacyBond (r:1 w:0) + // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + /// The range of component `c` is `[1, 1000]`. + fn register_as_candidate(c: u32, ) -> Weight { + Weight::from_ref_time(61_940_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(170_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: CollatorSelection Candidates (r:1 w:1) + // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + /// The range of component `c` is `[6, 1000]`. + fn leave_intent(c: u32, ) -> Weight { + Weight::from_ref_time(60_018_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(162_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: System Account (r:2 w:2) + // Storage: System BlockWeight (r:1 w:1) + // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) + fn note_author() -> Weight { + Weight::from_ref_time(35_100_000 as u64) + .saturating_add(T::DbWeight::get().reads(3 as u64)) + .saturating_add(T::DbWeight::get().writes(4 as u64)) + } + // Storage: CollatorSelection Candidates (r:1 w:1) + // Storage: CollatorSelection LastAuthoredBlock (r:1000 w:1) + // Storage: System Account (r:1 w:1) + // Storage: CollatorSelection Invulnerables (r:1 w:0) + // Storage: System BlockWeight (r:1 w:1) + /// The range of component `r` is `[1, 1000]`. + /// The range of component `c` is `[1, 1000]`. + fn new_session(r: u32, c: u32, ) -> Weight { + Weight::from_ref_time(0 as u64) + // Standard Error: 1_237_000 + .saturating_add(Weight::from_ref_time(6_686_000 as u64).saturating_mul(r as u64)) + // Standard Error: 1_237_000 + .saturating_add(Weight::from_ref_time(32_537_000 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(c as u64))) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs new file mode 100644 index 00000000000..0948531fc0e --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs @@ -0,0 +1,63 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_session` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=statemine-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_session +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_session.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight}}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_session`. +pub struct WeightInfo(PhantomData); +impl pallet_session::WeightInfo for WeightInfo { + // Storage: Session NextKeys (r:1 w:1) + // Storage: Session KeyOwner (r:1 w:1) + fn set_keys() -> Weight { + Weight::from_ref_time(23_807_000 as u64) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: Session NextKeys (r:1 w:1) + // Storage: Session KeyOwner (r:0 w:1) + fn purge_keys() -> Weight { + Weight::from_ref_time(20_676_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index d70a2a3986f..b70531ff964 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -8,12 +8,13 @@ use frame_support::{ traits::{Everything, Nothing}, }; use pallet_xcm::XcmPassthrough; +use parachains_common::xcm_config::ConcreteNativeAssetFrom; use polkadot_parachain::primitives::Sibling; use polkadot_runtime_common::impls::ToAuthor; use xcm::latest::{prelude::*, Weight as XCMWeight}; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, - EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset, ParentIsPreset, + EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, @@ -168,8 +169,11 @@ impl xcm_executor::Config for XcmConfig { // How to withdraw and deposit an asset. type AssetTransactor = LocalAssetTransactor; type OriginConverter = XcmOriginToTransactDispatchOrigin; - type IsReserve = NativeAsset; - type IsTeleporter = (); // Teleporting is disabled. + // BridgeHub does not recognize a reserve location for any asset. Users must teleport Native token + // where allowed (e.g. with the Relay Chain). + type IsReserve = (); + /// Only allow teleportation of NativeToken of relay chain. + type IsTeleporter = ConcreteNativeAssetFrom; type LocationInverter = LocationInverter; type Barrier = Barrier; type Weigher = FixedWeightBounds; diff --git a/parachains/runtimes/testing/penpal/src/lib.rs b/parachains/runtimes/testing/penpal/src/lib.rs index f439df48b1c..7350b902410 100644 --- a/parachains/runtimes/testing/penpal/src/lib.rs +++ b/parachains/runtimes/testing/penpal/src/lib.rs @@ -441,7 +441,6 @@ impl cumulus_pallet_dmp_queue::Config for Runtime { parameter_types! { pub const Period: u32 = 6 * HOURS; pub const Offset: u32 = 0; - pub const MaxAuthorities: u32 = 100_000; } impl pallet_session::Config for Runtime { @@ -461,7 +460,7 @@ impl pallet_session::Config for Runtime { impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; + type MaxAuthorities = ConstU32<100_000>; } parameter_types! { diff --git a/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/parachains/runtimes/testing/rococo-parachain/src/lib.rs index 083f41d46ef..e461e258b7f 100644 --- a/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -478,7 +478,6 @@ parameter_types! { pub const MetadataDepositBase: Balance = 1 * ROC; pub const MetadataDepositPerByte: Balance = 10 * MILLIROC; pub const UnitBody: BodyId = BodyId::Unit; - pub const MaxAuthorities: u32 = 100_000; } /// A majority of the Unit body from Rococo over XCM is our required administration origin. @@ -506,7 +505,7 @@ impl pallet_assets::Config for Runtime { impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); - type MaxAuthorities = MaxAuthorities; + type MaxAuthorities = ConstU32<100_000>; } construct_runtime! { From 4210b39b3b9a4d89ee50c7a715756c1b7f7e0efa Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 15 Nov 2022 13:50:34 +0100 Subject: [PATCH 12/39] Fixes --- .../bridge-hub-kusama/src/xcm_config.rs | 122 +++++------------- .../bridge-hub-rococo/src/xcm_config.rs | 122 +++++------------- .../runtimes/testing/penpal/src/xcm_config.rs | 70 +--------- 3 files changed, 72 insertions(+), 242 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index 71766a8b793..f05b52085a4 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -2,24 +2,25 @@ use super::{ AccountId, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, }; -use core::marker::PhantomData; use frame_support::{ - log, match_types, parameter_types, + match_types, parameter_types, traits::{Everything, Nothing}, }; use pallet_xcm::XcmPassthrough; -use parachains_common::xcm_config::ConcreteNativeAssetFrom; +use parachains_common::xcm_config::{ + ConcreteNativeAssetFrom, DenyReserveTransferToRelayChain, DenyThenTry, +}; use polkadot_parachain::primitives::Sibling; use polkadot_runtime_common::impls::ToAuthor; -use xcm::latest::{prelude::*, Weight as XCMWeight}; +use xcm::latest::prelude::*; use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, - EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, ParentIsPreset, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - UsingComponents, + AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, + AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, + FixedWeightBounds, IsConcrete, LocationInverter, ParentIsPreset, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, }; -use xcm_executor::{traits::ShouldExecute, XcmExecutor}; +use xcm_executor::XcmExecutor; parameter_types! { pub const KsmRelayLocation: MultiLocation = MultiLocation::parent(); @@ -40,8 +41,8 @@ pub type LocationToAccountId = ( AccountId32Aliases, ); -/// Means for transacting assets on this chain. -pub type LocalAssetTransactor = CurrencyAdapter< +/// Means for transacting the native currency on this chain. +pub type CurrencyTransactor = CurrencyAdapter< // Use this currency: Balances, // Use this currency when it is a fungible asset matching the given location or name: @@ -86,79 +87,25 @@ match_types! { MultiLocation { parents: 1, interior: Here } | MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } }; -} - -//TODO: move DenyThenTry to polkadot's xcm module. -/// Deny executing the xcm message if it matches any of the Deny filter regardless of anything else. -/// If it passes the Deny, and matches one of the Allow cases then it is let through. -pub struct DenyThenTry(PhantomData, PhantomData) -where - Deny: ShouldExecute, - Allow: ShouldExecute; - -impl ShouldExecute for DenyThenTry -where - Deny: ShouldExecute, - Allow: ShouldExecute, -{ - fn should_execute( - origin: &MultiLocation, - message: &mut Xcm, - max_weight: XCMWeight, - weight_credit: &mut XCMWeight, - ) -> Result<(), ()> { - Deny::should_execute(origin, message, max_weight, weight_credit)?; - Allow::should_execute(origin, message, max_weight, weight_credit) - } -} - -// See issue #5233 -pub struct DenyReserveTransferToRelayChain; -impl ShouldExecute for DenyReserveTransferToRelayChain { - fn should_execute( - origin: &MultiLocation, - message: &mut Xcm, - _max_weight: XCMWeight, - _weight_credit: &mut XCMWeight, - ) -> Result<(), ()> { - if message.0.iter().any(|inst| { - matches!( - inst, - InitiateReserveWithdraw { - reserve: MultiLocation { parents: 1, interior: Here }, - .. - } | DepositReserveAsset { dest: MultiLocation { parents: 1, interior: Here }, .. } | - TransferReserveAsset { - dest: MultiLocation { parents: 1, interior: Here }, - .. - } - ) - }) { - return Err(()) // Deny - } - - // An unexpected reserve transfer has arrived from the Relay Chain. Generally, `IsReserve` - // should not allow this, but we just log it here. - if matches!(origin, MultiLocation { parents: 1, interior: Here }) && - message.0.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. })) - { - log::warn!( - target: "xcm::barriers", - "Unexpected ReserveAssetDeposited from the Relay Chain", - ); - } - // Permit everything else - Ok(()) - } + pub type ParentOrSiblings: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(_) } + }; } pub type Barrier = DenyThenTry< DenyReserveTransferToRelayChain, ( + // Allow local users to buy weight credit. TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, + // Parent and its exec plurality get free execution. AllowUnpaidExecutionFrom, - // ^^^ Parent and its exec plurality get free execution + // Expected responses are OK. + AllowKnownQueryResponses, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + // Allow anything to pay for execution. + AllowTopLevelPaidExecutionFrom, ), >; @@ -166,8 +113,7 @@ pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; - // How to withdraw and deposit an asset. - type AssetTransactor = LocalAssetTransactor; + type AssetTransactor = CurrencyTransactor; type OriginConverter = XcmOriginToTransactDispatchOrigin; // BridgeHub does not recognize a reserve location for any asset. Users must teleport KSM // where allowed (e.g. with the Relay Chain). @@ -185,36 +131,36 @@ impl xcm_executor::Config for XcmConfig { type SubscriptionService = PolkadotXcm; } -/// No local origins on this chain are allowed to dispatch XCM sends/executions. +/// Converts a local signed origin into an XCM multilocation. +/// 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 = ( // Two routers - use UMP to communicate with the relay chain: - cumulus_primitives_utility::ParentAsUmp, + 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; + // We want to disallow users sending (arbitrary) XCMs from this chain. + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; + // We support local origins dispatching XCM executions in principle... type ExecuteXcmOrigin = EnsureXcmOrigin; + // ... but disallow generic XCM execution. As a result only teleports are allowed. type XcmExecuteFilter = Nothing; - // ^ Disable dispatchable execute on the XCM pallet. - // Needs to be `Everything` for local testing. type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; - type XcmReserveTransferFilter = Nothing; + type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location. type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; - // ^ Override for AdvertisedXcmVersion default type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index b70531ff964..64a2d16f6c8 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -2,24 +2,25 @@ use super::{ AccountId, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, }; -use core::marker::PhantomData; use frame_support::{ - log, match_types, parameter_types, + match_types, parameter_types, traits::{Everything, Nothing}, }; use pallet_xcm::XcmPassthrough; -use parachains_common::xcm_config::ConcreteNativeAssetFrom; +use parachains_common::xcm_config::{ + ConcreteNativeAssetFrom, DenyReserveTransferToRelayChain, DenyThenTry, +}; use polkadot_parachain::primitives::Sibling; use polkadot_runtime_common::impls::ToAuthor; -use xcm::latest::{prelude::*, Weight as XCMWeight}; +use xcm::latest::prelude::*; use xcm_builder::{ - AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, - EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, ParentIsPreset, - RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - UsingComponents, + AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, + AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, + FixedWeightBounds, IsConcrete, LocationInverter, ParentIsPreset, RelayChainAsNative, + SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, }; -use xcm_executor::{traits::ShouldExecute, XcmExecutor}; +use xcm_executor::XcmExecutor; parameter_types! { pub const RelayLocation: MultiLocation = MultiLocation::parent(); @@ -40,8 +41,8 @@ pub type LocationToAccountId = ( AccountId32Aliases, ); -/// Means for transacting assets on this chain. -pub type LocalAssetTransactor = CurrencyAdapter< +/// Means for transacting the native currency on this chain. +pub type CurrencyTransactor = CurrencyAdapter< // Use this currency: Balances, // Use this currency when it is a fungible asset matching the given location or name: @@ -86,79 +87,25 @@ match_types! { MultiLocation { parents: 1, interior: Here } | MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } }; -} - -//TODO: move DenyThenTry to polkadot's xcm module. -/// Deny executing the xcm message if it matches any of the Deny filter regardless of anything else. -/// If it passes the Deny, and matches one of the Allow cases then it is let through. -pub struct DenyThenTry(PhantomData, PhantomData) -where - Deny: ShouldExecute, - Allow: ShouldExecute; - -impl ShouldExecute for DenyThenTry -where - Deny: ShouldExecute, - Allow: ShouldExecute, -{ - fn should_execute( - origin: &MultiLocation, - message: &mut Xcm, - max_weight: XCMWeight, - weight_credit: &mut XCMWeight, - ) -> Result<(), ()> { - Deny::should_execute(origin, message, max_weight, weight_credit)?; - Allow::should_execute(origin, message, max_weight, weight_credit) - } -} - -// See issue #5233 -pub struct DenyReserveTransferToRelayChain; -impl ShouldExecute for DenyReserveTransferToRelayChain { - fn should_execute( - origin: &MultiLocation, - message: &mut Xcm, - _max_weight: XCMWeight, - _weight_credit: &mut XCMWeight, - ) -> Result<(), ()> { - if message.0.iter().any(|inst| { - matches!( - inst, - InitiateReserveWithdraw { - reserve: MultiLocation { parents: 1, interior: Here }, - .. - } | DepositReserveAsset { dest: MultiLocation { parents: 1, interior: Here }, .. } | - TransferReserveAsset { - dest: MultiLocation { parents: 1, interior: Here }, - .. - } - ) - }) { - return Err(()) // Deny - } - - // An unexpected reserve transfer has arrived from the Relay Chain. Generally, `IsReserve` - // should not allow this, but we just log it here. - if matches!(origin, MultiLocation { parents: 1, interior: Here }) && - message.0.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. })) - { - log::warn!( - target: "xcm::barriers", - "Unexpected ReserveAssetDeposited from the Relay Chain", - ); - } - // Permit everything else - Ok(()) - } + pub type ParentOrSiblings: impl Contains = { + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(_) } + }; } pub type Barrier = DenyThenTry< DenyReserveTransferToRelayChain, ( + // Allow local users to buy weight credit. TakeWeightCredit, - AllowTopLevelPaidExecutionFrom, + // Parent and its exec plurality get free execution. AllowUnpaidExecutionFrom, - // ^^^ Parent and its exec plurality get free execution + // Expected responses are OK. + AllowKnownQueryResponses, + // Subscriptions for version tracking are OK. + AllowSubscriptionsFrom, + // Allow anything to pay for execution. + AllowTopLevelPaidExecutionFrom, ), >; @@ -166,8 +113,7 @@ pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type RuntimeCall = RuntimeCall; type XcmSender = XcmRouter; - // How to withdraw and deposit an asset. - type AssetTransactor = LocalAssetTransactor; + type AssetTransactor = CurrencyTransactor; type OriginConverter = XcmOriginToTransactDispatchOrigin; // BridgeHub does not recognize a reserve location for any asset. Users must teleport Native token // where allowed (e.g. with the Relay Chain). @@ -185,36 +131,36 @@ impl xcm_executor::Config for XcmConfig { type SubscriptionService = PolkadotXcm; } -/// No local origins on this chain are allowed to dispatch XCM sends/executions. +/// Converts a local signed origin into an XCM multilocation. +/// 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 = ( // Two routers - use UMP to communicate with the relay chain: - cumulus_primitives_utility::ParentAsUmp, + 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; + // We want to disallow users sending (arbitrary) XCMs from this chain. + type SendXcmOrigin = EnsureXcmOrigin; type XcmRouter = XcmRouter; + // We support local origins dispatching XCM executions in principle... type ExecuteXcmOrigin = EnsureXcmOrigin; + // ... but disallow generic XCM execution. As a result only teleports are allowed. type XcmExecuteFilter = Nothing; - // ^ Disable dispatchable execute on the XCM pallet. - // Needs to be `Everything` for local testing. type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; - type XcmReserveTransferFilter = Nothing; + type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location. type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; - // ^ Override for AdvertisedXcmVersion default type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } diff --git a/parachains/runtimes/testing/penpal/src/xcm_config.rs b/parachains/runtimes/testing/penpal/src/xcm_config.rs index 87159950350..b4621d1ef2c 100644 --- a/parachains/runtimes/testing/penpal/src/xcm_config.rs +++ b/parachains/runtimes/testing/penpal/src/xcm_config.rs @@ -28,7 +28,7 @@ use super::{ }; use core::marker::PhantomData; use frame_support::{ - log, match_types, parameter_types, + match_types, parameter_types, traits::{ fungibles::{self, Balanced, CreditOf}, Contains, Everything, Get, Nothing, @@ -36,10 +36,11 @@ use frame_support::{ }; use pallet_asset_tx_payment::HandleCredit; use pallet_xcm::XcmPassthrough; +use parachains_common::xcm_config::{DenyReserveTransferToRelayChain, DenyThenTry}; use polkadot_parachain::primitives::Sibling; use polkadot_runtime_common::impls::ToAuthor; use sp_runtime::traits::Zero; -use xcm::latest::{prelude::*, Weight as XCMWeight}; +use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex, @@ -50,7 +51,7 @@ use xcm_builder::{ UsingComponents, }; use xcm_executor::{ - traits::{FilterAssetLocation, JustTry, ShouldExecute}, + traits::{FilterAssetLocation, JustTry}, XcmExecutor, }; @@ -149,69 +150,6 @@ match_types! { }; } -//TODO: move DenyThenTry to polkadot's xcm module. -/// Deny executing the xcm message if it matches any of the Deny filter regardless of anything else. -/// If it passes the Deny, and matches one of the Allow cases then it is let through. -pub struct DenyThenTry(PhantomData, PhantomData) -where - Deny: ShouldExecute, - Allow: ShouldExecute; - -impl ShouldExecute for DenyThenTry -where - Deny: ShouldExecute, - Allow: ShouldExecute, -{ - fn should_execute( - origin: &MultiLocation, - message: &mut Xcm, - max_weight: XCMWeight, - weight_credit: &mut XCMWeight, - ) -> Result<(), ()> { - Deny::should_execute(origin, message, max_weight, weight_credit)?; - Allow::should_execute(origin, message, max_weight, weight_credit) - } -} - -// See issue #5233 -pub struct DenyReserveTransferToRelayChain; -impl ShouldExecute for DenyReserveTransferToRelayChain { - fn should_execute( - origin: &MultiLocation, - message: &mut Xcm, - _max_weight: XCMWeight, - _weight_credit: &mut XCMWeight, - ) -> Result<(), ()> { - if message.0.iter().any(|inst| { - matches!( - inst, - InitiateReserveWithdraw { - reserve: MultiLocation { parents: 1, interior: Here }, - .. - } | DepositReserveAsset { dest: MultiLocation { parents: 1, interior: Here }, .. } | - TransferReserveAsset { - dest: MultiLocation { parents: 1, interior: Here }, - .. - } - ) - }) { - return Err(()) // Deny - } - - // allow reserve transfers to arrive from relay chain - if matches!(origin, MultiLocation { parents: 1, interior: Here }) && - message.0.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. })) - { - log::warn!( - target: "xcm::barriers", - "Unexpected ReserveAssetDeposited from the relay chain", - ); - } - // Permit everything else - Ok(()) - } -} - pub type Barrier = DenyThenTry< DenyReserveTransferToRelayChain, ( From afc6cafc2768cb9daab16524c7e691bccd52bc1d Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 15 Nov 2022 16:41:13 +0100 Subject: [PATCH 13/39] Fix kusama-local --- Cargo.lock | 2 + .../bridge-hubs/bridge-hub-kusama/src/lib.rs | 2 +- .../bridge-hubs/bridge-hub-rococo/Cargo.toml | 4 + .../bridge-hub-rococo/src/constants.rs | 64 +++++++ .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 1 + .../src/chain_spec/bridge_hubs.rs | 172 +++++++++++++++--- polkadot-parachain/src/command.rs | 6 +- 7 files changed, 223 insertions(+), 28 deletions(-) create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/constants.rs diff --git a/Cargo.lock b/Cargo.lock index af5ca767fd6..5e156f08bc3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -789,8 +789,10 @@ dependencies = [ "parachain-info", "parachains-common", "parity-scale-codec", + "polkadot-core-primitives", "polkadot-parachain 0.9.31", "polkadot-runtime-common", + "rococo-runtime-constants", "scale-info", "serde", "smallvec", diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index 3629d96125a..08c97c95168 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -22,7 +22,7 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -mod constants; +pub mod constants; mod weights; pub mod xcm_config; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index ee91400f348..264a60ef69a 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -46,7 +46,9 @@ sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } # Polkadot +rococo-runtime-constants = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } @@ -99,8 +101,10 @@ std = [ "pallet-transaction-payment/std", "pallet-xcm/std", "parachain-info/std", + "polkadot-core-primitives/std", "polkadot-parachain/std", "polkadot-runtime-common/std", + "rococo-runtime-constants/std", "sp-api/std", "sp-block-builder/std", "sp-consensus-aura/std", diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/constants.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/constants.rs new file mode 100644 index 00000000000..ab716741d37 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/constants.rs @@ -0,0 +1,64 @@ +// 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 currency { + use polkadot_core_primitives::Balance; + use rococo_runtime_constants as constants; + + /// The existential deposit. Set to 1/10 of its parent Relay Chain (v9010). + pub const EXISTENTIAL_DEPOSIT: Balance = constants::currency::EXISTENTIAL_DEPOSIT / 10; + + pub const CENTS: Balance = constants::currency::CENTS; +} + +pub mod fee { + use frame_support::weights::{ + constants::ExtrinsicBaseWeight, WeightToFeeCoefficient, WeightToFeeCoefficients, + WeightToFeePolynomial, + }; + use polkadot_core_primitives::Balance; + use smallvec::smallvec; + pub use sp_runtime::Perbill; + + /// The block saturation level. Fees will be updates based on this value. + pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25); + + /// Handles converting a weight scalar to a fee value, based on the scale and granularity of the + /// node's balance type. + /// + /// This should typically create a mapping between the following ranges: + /// - `[0, MAXIMUM_BLOCK_WEIGHT]` + /// - `[Balance::min, Balance::max]` + /// + /// Yet, it can be used for any other sort of change to weight-fee. Some examples being: + /// - Setting it to `0` will essentially disable the weight fee. + /// - Setting it to `1` will cause the literal `#[weight = x]` values to be charged. + pub struct WeightToFee; + impl WeightToFeePolynomial for WeightToFee { + type Balance = Balance; + fn polynomial() -> WeightToFeeCoefficients { + // in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT: + // in BridgeHub, we map to 1/10 of that, or 1/100 CENT + let p = super::currency::CENTS; + let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); + smallvec![WeightToFeeCoefficient { + degree: 1, + negative: false, + coeff_frac: Perbill::from_rational(p % q, q), + coeff_integer: p / q, + }] + } + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 20d43cdaca7..93e0c645f29 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -22,6 +22,7 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +pub mod constants; mod weights; pub mod xcm_config; diff --git a/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/polkadot-parachain/src/chain_spec/bridge_hubs.rs index cf7df0f0795..f036b825a4f 100644 --- a/polkadot-parachain/src/chain_spec/bridge_hubs.rs +++ b/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -29,6 +29,7 @@ pub enum BridgeHubRuntimeType { WococoLocal, Kusama, + KusamaLocal, } impl FromStr for BridgeHubRuntimeType { @@ -37,6 +38,7 @@ impl FromStr for BridgeHubRuntimeType { fn from_str(value: &str) -> Result { match value { kusama::BRIDGE_HUB_KUSAMA => Ok(BridgeHubRuntimeType::Kusama), + kusama::BRIDGE_HUB_KUSAMA_LOCAL => Ok(BridgeHubRuntimeType::KusamaLocal), rococo::BRIDGE_HUB_ROCOCO => Ok(BridgeHubRuntimeType::Rococo), rococo::BRIDGE_HUB_ROCOCO_LOCAL => Ok(BridgeHubRuntimeType::RococoLocal), wococo::BRIDGE_HUB_WOCOCO => Ok(BridgeHubRuntimeType::Wococo), @@ -51,15 +53,11 @@ impl BridgeHubRuntimeType { pub fn chain_spec_from_json_file(&self, path: PathBuf) -> Result, String> { match self { - BridgeHubRuntimeType::Kusama => + BridgeHubRuntimeType::Kusama | BridgeHubRuntimeType::KusamaLocal => Ok(Box::new(kusama::BridgeHubChainSpec::from_json_file(path)?)), - BridgeHubRuntimeType::Rococo => - Ok(Box::new(rococo::BridgeHubChainSpec::from_json_file(path)?)), - BridgeHubRuntimeType::RococoLocal => + BridgeHubRuntimeType::Rococo | BridgeHubRuntimeType::RococoLocal => Ok(Box::new(rococo::BridgeHubChainSpec::from_json_file(path)?)), - BridgeHubRuntimeType::Wococo => - Ok(Box::new(wococo::BridgeHubChainSpec::from_json_file(path)?)), - BridgeHubRuntimeType::WococoLocal => + BridgeHubRuntimeType::Wococo | BridgeHubRuntimeType::WococoLocal => Ok(Box::new(wococo::BridgeHubChainSpec::from_json_file(path)?)), } } @@ -70,17 +68,25 @@ impl BridgeHubRuntimeType { Ok(Box::new(kusama::BridgeHubChainSpec::from_json_bytes( &include_bytes!("../../../parachains/chain-specs/bridge-hub-kusama.json")[..], )?)), + BridgeHubRuntimeType::KusamaLocal => Ok(Box::new(kusama::local_config( + kusama::BRIDGE_HUB_KUSAMA_LOCAL, + "Kusama BrideHub Local", + "kusama-local", + ParaId::new(1003), + ))), BridgeHubRuntimeType::Rococo => Ok(Box::new(rococo::live_config( rococo::BRIDGE_HUB_ROCOCO, "Rococo BrideHub", "rococo", ParaId::new(1013), + |_| (), ))), BridgeHubRuntimeType::RococoLocal => Ok(Box::new(rococo::local_config( rococo::BRIDGE_HUB_ROCOCO_LOCAL, "Rococo BrideHub Local", "rococo-local", ParaId::new(1013), + |_| (), ))), BridgeHubRuntimeType::Wococo => Ok(Box::new(wococo::live_config( wococo::BRIDGE_HUB_WOCOCO, @@ -99,7 +105,8 @@ impl BridgeHubRuntimeType { pub fn runtime_version(&self) -> &'static RuntimeVersion { match self { - BridgeHubRuntimeType::Kusama => &bridge_hub_kusama_runtime::VERSION, + BridgeHubRuntimeType::Kusama | BridgeHubRuntimeType::KusamaLocal => + &bridge_hub_kusama_runtime::VERSION, BridgeHubRuntimeType::Rococo | BridgeHubRuntimeType::Wococo | BridgeHubRuntimeType::RococoLocal | @@ -136,6 +143,8 @@ pub mod rococo { pub(crate) const BRIDGE_HUB_ROCOCO: &str = "bridge-hub-rococo"; pub(crate) const BRIDGE_HUB_ROCOCO_LOCAL: &str = "bridge-hub-rococo-local"; + const BRIDGE_HUB_ROCOCO_ED: bridge_hub_rococo_runtime::Balance = + bridge_hub_rococo_runtime::constants::currency::EXISTENTIAL_DEPOSIT; /// Specialized `ChainSpec` for the normal parachain runtime. pub type BridgeHubChainSpec = @@ -143,17 +152,19 @@ pub mod rococo { pub type RuntimeApi = bridge_hub_rococo_runtime::RuntimeApi; - pub fn live_config( + pub fn live_config( id: &str, chain_name: &str, relay_chain: &str, para_id: ParaId, + modify_props: ModifyProperties, ) -> BridgeHubChainSpec { - let properties = sc_chain_spec::Properties::new(); - // TODO: check - // properties.insert("ss58Format".into(), 2.into()); - // properties.insert("tokenSymbol".into(), "ROC".into()); - // properties.insert("tokenDecimals".into(), 12.into()); + // 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()); + modify_props(&mut properties); BridgeHubChainSpec::from_genesis( // Name @@ -200,17 +211,19 @@ pub mod rococo { ) } - pub fn local_config( + pub fn local_config( id: &str, chain_name: &str, relay_chain: &str, para_id: ParaId, + modify_props: ModifyProperties, ) -> BridgeHubChainSpec { - let properties = sc_chain_spec::Properties::new(); - // TODO: check - // properties.insert("ss58Format".into(), 2.into()); - // properties.insert("tokenSymbol".into(), "ROC".into()); - // properties.insert("tokenDecimals".into(), 12.into()); + // 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()); + modify_props(&mut properties); BridgeHubChainSpec::from_genesis( // Name @@ -274,8 +287,7 @@ pub mod rococo { parachain_info: bridge_hub_rococo_runtime::ParachainInfoConfig { parachain_id: id }, collator_selection: bridge_hub_rococo_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), - // TODO: check - candidacy_bond: 10, + candidacy_bond: BRIDGE_HUB_ROCOCO_ED * 16, ..Default::default() }, session: bridge_hub_rococo_runtime::SessionConfig { @@ -317,7 +329,9 @@ pub mod wococo { relay_chain: &str, para_id: ParaId, ) -> BridgeHubChainSpec { - rococo::local_config(id, chain_name, relay_chain, para_id) + rococo::local_config(id, chain_name, relay_chain, para_id, |properties| { + properties.insert("tokenSymbol".into(), "WOOK".into()); + }) } pub fn live_config( @@ -326,18 +340,126 @@ pub mod wococo { relay_chain: &str, para_id: ParaId, ) -> BridgeHubChainSpec { - rococo::live_config(id, chain_name, relay_chain, para_id) + rococo::live_config(id, chain_name, relay_chain, para_id, |properties| { + properties.insert("tokenSymbol".into(), "WOOK".into()); + }) } } /// Sub-module for Kusama setup (reuses stuff from Rococo) pub mod kusama { - use crate::chain_spec::Extensions; + use super::ParaId; + use crate::chain_spec::{ + get_account_id_from_seed, get_collator_keys_from_seed, Extensions, SAFE_XCM_VERSION, + }; + use parachains_common::{AccountId, AuraId}; + use sc_chain_spec::ChainType; + use sp_core::sr25519; pub(crate) const BRIDGE_HUB_KUSAMA: &str = "bridge-hub-kusama"; + pub(crate) const BRIDGE_HUB_KUSAMA_LOCAL: &str = "bridge-hub-kusama-local"; + const BRIDGE_HUB_KUSAMA_ED: bridge_hub_kusama_runtime::Balance = + bridge_hub_kusama_runtime::constants::currency::EXISTENTIAL_DEPOSIT; /// Specialized `ChainSpec` for the normal parachain runtime. pub type BridgeHubChainSpec = sc_service::GenericChainSpec; pub type RuntimeApi = bridge_hub_kusama_runtime::RuntimeApi; + + pub fn local_config( + id: &str, + chain_name: &str, + relay_chain: &str, + para_id: ParaId, + ) -> BridgeHubChainSpec { + let mut properties = sc_chain_spec::Properties::new(); + properties.insert("ss58Format".into(), 2.into()); + properties.insert("tokenSymbol".into(), "KSM".into()); + properties.insert("tokenDecimals".into(), 12.into()); + + BridgeHubChainSpec::from_genesis( + // Name + chain_name, + // ID + super::ensure_id(id).expect("invalid id"), + ChainType::Local, + move || { + genesis( + // initial collators. + vec![ + ( + get_account_id_from_seed::("Alice"), + get_collator_keys_from_seed::("Alice"), + ), + ( + get_account_id_from_seed::("Bob"), + get_collator_keys_from_seed::("Bob"), + ), + ], + vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Charlie"), + get_account_id_from_seed::("Dave"), + get_account_id_from_seed::("Eve"), + get_account_id_from_seed::("Ferdie"), + get_account_id_from_seed::("Alice//stash"), + get_account_id_from_seed::("Bob//stash"), + get_account_id_from_seed::("Charlie//stash"), + get_account_id_from_seed::("Dave//stash"), + get_account_id_from_seed::("Eve//stash"), + get_account_id_from_seed::("Ferdie//stash"), + ], + para_id, + ) + }, + Vec::new(), + None, + None, + None, + Some(properties), + Extensions { relay_chain: relay_chain.to_string(), para_id: para_id.into() }, + ) + } + + fn genesis( + invulnerables: Vec<(AccountId, AuraId)>, + endowed_accounts: Vec, + id: ParaId, + ) -> bridge_hub_kusama_runtime::GenesisConfig { + bridge_hub_kusama_runtime::GenesisConfig { + system: bridge_hub_kusama_runtime::SystemConfig { + code: bridge_hub_kusama_runtime::WASM_BINARY + .expect("WASM binary was not build, please build it!") + .to_vec(), + }, + balances: bridge_hub_kusama_runtime::BalancesConfig { + balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), + }, + parachain_info: bridge_hub_kusama_runtime::ParachainInfoConfig { parachain_id: id }, + collator_selection: bridge_hub_kusama_runtime::CollatorSelectionConfig { + invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), + candidacy_bond: BRIDGE_HUB_KUSAMA_ED * 16, + ..Default::default() + }, + session: bridge_hub_kusama_runtime::SessionConfig { + keys: invulnerables + .into_iter() + .map(|(acc, aura)| { + ( + acc.clone(), // account id + acc, // validator id + bridge_hub_kusama_runtime::SessionKeys { aura }, // session keys + ) + }) + .collect(), + }, + aura: Default::default(), + aura_ext: Default::default(), + parachain_system: Default::default(), + polkadot_xcm: bridge_hub_kusama_runtime::PolkadotXcmConfig { + safe_xcm_version: Some(SAFE_XCM_VERSION), + }, + } + } } diff --git a/polkadot-parachain/src/command.rs b/polkadot-parachain/src/command.rs index c597ea20273..ad828318d51 100644 --- a/polkadot-parachain/src/command.rs +++ b/polkadot-parachain/src/command.rs @@ -478,7 +478,8 @@ macro_rules! construct_async_run { }, Runtime::BridgeHub(bridge_hub_runtime_type) => { match bridge_hub_runtime_type { - chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama => { + chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama | + chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaLocal => { runner.async_run(|$config| { let $components = new_partial::( &$config, @@ -799,7 +800,8 @@ pub fn run() -> Result<()> { .map(|r| r.0) .map_err(Into::into), Runtime::BridgeHub(bridge_hub_runtime_type) => match bridge_hub_runtime_type { - chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama => + chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama | + chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaLocal => crate::service::start_generic_aura_node::< chain_spec::bridge_hubs::kusama::RuntimeApi, AuraId, From 601abfe1067ed896a770a953fb32dc3be4f9867f Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 16 Nov 2022 13:14:05 +0100 Subject: [PATCH 14/39] Sample zombienet runs --- .../bridge-hubs/bridge-hub-kusama/src/lib.rs | 1 - .../src/chain_spec/bridge_hubs.rs | 6 +- .../bridge_hub_kusama_local_network.toml | 67 +++++++++++++++++++ .../bridge_hub_rococo_local_network.toml | 67 +++++++++++++++++++ .../statemine_kusama_local_network.toml | 67 +++++++++++++++++++ 5 files changed, 206 insertions(+), 2 deletions(-) create mode 100644 zombienet/examples/bridge_hub_kusama_local_network.toml create mode 100644 zombienet/examples/bridge_hub_rococo_local_network.toml create mode 100644 zombienet/examples/statemine_kusama_local_network.toml diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index 08c97c95168..da5d0a9072d 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -247,7 +247,6 @@ impl frame_system::Config for Runtime { type BlockWeights = RuntimeBlockWeights; /// The maximum length of a block (in bytes). type BlockLength = RuntimeBlockLength; - /// This is used as an identifier of the chain. 42 is the generic substrate prefix. type SS58Prefix = SS58Prefix; /// The action to take on a Runtime Upgrade type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; diff --git a/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/polkadot-parachain/src/chain_spec/bridge_hubs.rs index f036b825a4f..59efe899f7f 100644 --- a/polkadot-parachain/src/chain_spec/bridge_hubs.rs +++ b/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -434,7 +434,11 @@ pub mod kusama { .to_vec(), }, balances: bridge_hub_kusama_runtime::BalancesConfig { - balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), + balances: endowed_accounts + .iter() + .cloned() + .map(|k| (k, BRIDGE_HUB_KUSAMA_ED * 524_288)) + .collect(), }, parachain_info: bridge_hub_kusama_runtime::ParachainInfoConfig { parachain_id: id }, collator_selection: bridge_hub_kusama_runtime::CollatorSelectionConfig { diff --git a/zombienet/examples/bridge_hub_kusama_local_network.toml b/zombienet/examples/bridge_hub_kusama_local_network.toml new file mode 100644 index 00000000000..ae8ae07a75c --- /dev/null +++ b/zombienet/examples/bridge_hub_kusama_local_network.toml @@ -0,0 +1,67 @@ +[relaychain] +default_command = "../polkadot/target/release/polkadot" +default_args = [ "-lparachain=debug" ] +chain = "kusama-local" + + [[relaychain.nodes]] + name = "alice" + validator = true + + [[relaychain.nodes]] + name = "bob" + validator = true + + [[relaychain.nodes]] + name = "charlie" + validator = true + + [[relaychain.nodes]] + name = "dave" + validator = true + +[[parachains]] +id = 1003 +chain = "bridge-hub-kusama-local" +cumulus_based = true + + # run alice as parachain collator + [[parachains.collators]] + name = "alice" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run bob as parachain collator + [[parachains.collators]] + name = "bob" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run charlie as parachain collator + [[parachains.collators]] + name = "charlie" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run dave as parachain collator + [[parachains.collators]] + name = "dave" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run eve as parachain collator + [[parachains.collators]] + name = "eve" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run ferdie as parachain collator + [[parachains.collators]] + name = "ferdie" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] diff --git a/zombienet/examples/bridge_hub_rococo_local_network.toml b/zombienet/examples/bridge_hub_rococo_local_network.toml new file mode 100644 index 00000000000..92a2397ab9d --- /dev/null +++ b/zombienet/examples/bridge_hub_rococo_local_network.toml @@ -0,0 +1,67 @@ +[relaychain] +default_command = "../polkadot/target/release/polkadot" +default_args = [ "-lparachain=debug" ] +chain = "rococo-local" + + [[relaychain.nodes]] + name = "alice" + validator = true + + [[relaychain.nodes]] + name = "bob" + validator = true + + [[relaychain.nodes]] + name = "charlie" + validator = true + + [[relaychain.nodes]] + name = "dave" + validator = true + +[[parachains]] +id = 1013 +chain = "bridge-hub-rococo-local" +cumulus_based = true + + # run alice as parachain collator + [[parachains.collators]] + name = "alice" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run bob as parachain collator + [[parachains.collators]] + name = "bob" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run charlie as parachain collator + [[parachains.collators]] + name = "charlie" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run dave as parachain collator + [[parachains.collators]] + name = "dave" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run eve as parachain collator + [[parachains.collators]] + name = "eve" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run ferdie as parachain collator + [[parachains.collators]] + name = "ferdie" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] diff --git a/zombienet/examples/statemine_kusama_local_network.toml b/zombienet/examples/statemine_kusama_local_network.toml new file mode 100644 index 00000000000..01d1b0b2d21 --- /dev/null +++ b/zombienet/examples/statemine_kusama_local_network.toml @@ -0,0 +1,67 @@ +[relaychain] +default_command = "../polkadot/target/release/polkadot" +default_args = [ "-lparachain=debug" ] +chain = "kusama-local" + + [[relaychain.nodes]] + name = "alice" + validator = true + + [[relaychain.nodes]] + name = "bob" + validator = true + + [[relaychain.nodes]] + name = "charlie" + validator = true + + [[relaychain.nodes]] + name = "dave" + validator = true + +[[parachains]] +id = 1000 +chain = "statemine-local" +cumulus_based = true + + # run alice as parachain collator + [[parachains.collators]] + name = "alice" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run bob as parachain collator + [[parachains.collators]] + name = "bob" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run charlie as parachain collator + [[parachains.collators]] + name = "charlie" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run dave as parachain collator + [[parachains.collators]] + name = "dave" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run eve as parachain collator + [[parachains.collators]] + name = "eve" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] + + # run ferdie as parachain collator + [[parachains.collators]] + name = "ferdie" + validator = true + command = "./target/release/polkadot-parachain" + args = ["-lparachain=debug"] From 53dc6a083f1edf4d36349e8be089a953a3a8c825 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 16 Nov 2022 13:47:53 +0100 Subject: [PATCH 15/39] Fixes --- .../bridge-hubs/bridge-hub-kusama/src/lib.rs | 13 ++++++++++--- .../bridge-hub-kusama/src/weights/block_weights.rs | 4 ++-- .../src/weights/extrinsic_weights.rs | 7 +++++-- .../src/weights/paritydb_weights.rs | 8 ++++---- .../src/weights/rocksdb_weights.rs | 8 ++++---- .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 13 ++++++++++--- .../bridge-hub-rococo/src/weights/block_weights.rs | 4 ++-- .../src/weights/extrinsic_weights.rs | 10 ++++++++-- .../src/weights/paritydb_weights.rs | 8 ++++---- .../src/weights/rocksdb_weights.rs | 8 ++++---- 10 files changed, 53 insertions(+), 30 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index da5d0a9072d..ac2b33efe44 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -552,13 +552,20 @@ impl_runtime_apis! { #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { fn on_runtime_upgrade() -> (Weight, Weight) { - log::info!("try-runtime::on_runtime_upgrade parachain-template."); + log::info!("try-runtime::on_runtime_upgrade bridge-hub-kusama."); let weight = Executive::try_runtime_upgrade().unwrap(); (weight, RuntimeBlockWeights::get().max_block) } - fn execute_block_no_check(block: Block) -> Weight { - Executive::execute_block_no_check(block) + fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight { + log::info!( + target: "runtime::bridge-hub-kusama", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}", + block.header.number, + block.header.hash(), + state_root_check, + select, + ); + Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed") } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/block_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/block_weights.rs index 608a9e346ea..c004307336d 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/block_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/block_weights.rs @@ -39,12 +39,12 @@ pub mod constants { // At least 100 µs. assert!( - w >= 100 * constants::WEIGHT_PER_MICROS.ref_time(), + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), "Weight should be at least 100 µs." ); // At most 50 ms. assert!( - w <= 50 * constants::WEIGHT_PER_MILLIS.ref_time(), + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), "Weight should be at most 50 ms." ); } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/extrinsic_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/extrinsic_weights.rs index 74d18830ef8..3ce6b73d584 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/extrinsic_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/extrinsic_weights.rs @@ -39,11 +39,14 @@ pub mod constants { // At least 10 µs. assert!( - w >= 10 * constants::WEIGHT_PER_MICROS.ref_time(), + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), "Weight should be at least 10 µs." ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS.ref_time(), "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/paritydb_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/paritydb_weights.rs index 9131d354509..dca7d348310 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/paritydb_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/paritydb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS.ref_time(), + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS.ref_time(), + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/rocksdb_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/rocksdb_weights.rs index 4ced5ec2e2e..87867ebfe17 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/rocksdb_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/rocksdb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS.ref_time(), + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS.ref_time(), + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 93e0c645f29..7d51a8aed3d 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -582,13 +582,20 @@ impl_runtime_apis! { #[cfg(feature = "try-runtime")] impl frame_try_runtime::TryRuntime for Runtime { fn on_runtime_upgrade() -> (Weight, Weight) { - log::info!("try-runtime::on_runtime_upgrade parachain-template."); + log::info!("try-runtime::on_runtime_upgrade bridge-hub-rococo."); let weight = Executive::try_runtime_upgrade().unwrap(); (weight, RuntimeBlockWeights::get().max_block) } - fn execute_block_no_check(block: Block) -> Weight { - Executive::execute_block_no_check(block) + fn execute_block(block: Block, state_root_check: bool, select: frame_try_runtime::TryStateSelect) -> Weight { + log::info!( + target: "runtime::bridge-hub-rococo", "try-runtime: executing block #{} ({:?}) / root checks: {:?} / sanity-checks: {:?}", + block.header.number, + block.header.hash(), + state_root_check, + select, + ); + Executive::try_execute_block(block, state_root_check, select).expect("try_execute_block failed") } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs index 608a9e346ea..c004307336d 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/block_weights.rs @@ -39,12 +39,12 @@ pub mod constants { // At least 100 µs. assert!( - w >= 100 * constants::WEIGHT_PER_MICROS.ref_time(), + w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(), "Weight should be at least 100 µs." ); // At most 50 ms. assert!( - w <= 50 * constants::WEIGHT_PER_MILLIS.ref_time(), + w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(), "Weight should be at most 50 ms." ); } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs index 834374b6fad..3ce6b73d584 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/extrinsic_weights.rs @@ -38,9 +38,15 @@ pub mod constants { let w = super::constants::ExtrinsicBaseWeight::get(); // At least 10 µs. - assert!(w >= 10 * constants::WEIGHT_PER_MICROS, "Weight should be at least 10 µs."); + assert!( + w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(), + "Weight should be at least 10 µs." + ); // At most 1 ms. - assert!(w <= constants::WEIGHT_PER_MILLIS, "Weight should be at most 1 ms."); + assert!( + w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), + "Weight should be at most 1 ms." + ); } } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs index 9131d354509..dca7d348310 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/paritydb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS.ref_time(), + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS.ref_time(), + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs index 4ced5ec2e2e..87867ebfe17 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/rocksdb_weights.rs @@ -42,20 +42,20 @@ pub mod constants { fn sane() { // At least 1 µs. assert!( - W::get().reads(1) >= constants::WEIGHT_PER_MICROS.ref_time(), + W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Read weight should be at least 1 µs." ); assert!( - W::get().writes(1) >= constants::WEIGHT_PER_MICROS.ref_time(), + W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(), "Write weight should be at least 1 µs." ); // At most 1 ms. assert!( - W::get().reads(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), + W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Read weight should be at most 1 ms." ); assert!( - W::get().writes(1) <= constants::WEIGHT_PER_MILLIS.ref_time(), + W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(), "Write weight should be at most 1 ms." ); } From c5bf12e18666f8e76c6b5cc38802ae663edb7971 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 16 Nov 2022 15:26:52 +0100 Subject: [PATCH 16/39] Fixes for benchmarking --- .github/workflows/release-30_create-draft.yml | 2 + Cargo.lock | 2 + .../bridge-hubs/bridge-hub-kusama/Cargo.toml | 26 ++++++-- .../bridge-hubs/bridge-hub-rococo/Cargo.toml | 26 ++++++-- .../src/weights/cumulus_pallet_xcmp_queue.rs | 18 +++--- .../src/weights/frame_system.rs | 58 +++++++++-------- .../src/weights/pallet_balances.rs | 35 ++++++----- .../src/weights/pallet_collator_selection.rs | 62 +++++++++--------- .../src/weights/pallet_session.rs | 20 +++--- .../src/weights/pallet_timestamp.rs | 20 +++--- .../src/chain_spec/bridge_hubs.rs | 37 +++++++++-- polkadot-parachain/src/command.rs | 63 ++++++++++++++++--- polkadot-parachain/src/service.rs | 30 +++++++++ scripts/benchmarks-ci.sh | 9 +++ scripts/benchmarks.sh | 3 + test/runtime/src/lib.rs | 8 ++- 16 files changed, 302 insertions(+), 117 deletions(-) diff --git a/.github/workflows/release-30_create-draft.yml b/.github/workflows/release-30_create-draft.yml index eda2e65a50c..6afc4b8d9da 100644 --- a/.github/workflows/release-30_create-draft.yml +++ b/.github/workflows/release-30_create-draft.yml @@ -155,6 +155,7 @@ jobs: STATEMINE_DIGEST: ${{ github.workspace}}/statemine-srtool-json/statemine-srtool-digest.json STATEMINT_DIGEST: ${{ github.workspace}}/statemint-srtool-json/statemint-srtool-digest.json BRIDGE_HUB_ROCOCO_DIGEST: ${{ github.workspace}}/bridge-hub-rococo-srtool-json/bridge-hub-rococo-srtool-digest.json + BRIDGE_HUB_KUSAMA_DIGEST: ${{ github.workspace}}/bridge-hub-kusama-srtool-json/bridge-hub-kusama-srtool-digest.json COLLECTIVES_POLKADOT_DIGEST: ${{ github.workspace}}/collectives-polkadot-srtool-json/collectives-polkadot-srtool-digest.json ROCOCO_PARA_DIGEST: ${{ github.workspace}}/rococo-parachain-srtool-json/rococo-parachain-srtool-digest.json CANVAS_KUSAMA_DIGEST: ${{ github.workspace}}/contracts-rococo-srtool-json/contracts-rococo-srtool-digest.json @@ -171,6 +172,7 @@ jobs: ls -al $STATEMINE_DIGEST || true ls -al $STATEMINT_DIGEST || true ls -al $BRIDGE_HUB_ROCOCO_DIGEST || true + ls -al $BRIDGE_HUB_KUSAMA_DIGEST || true ls -al $COLLECTIVES_POLKADOT_DIGEST || true ls -al $ROCOCO_PARA_DIGEST || true ls -al $CANVAS_KUSAMA_DIGEST || true diff --git a/Cargo.lock b/Cargo.lock index 62f8a3fa6ae..034f9869b49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -727,6 +727,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-xcm", + "pallet-xcm-benchmarks", "parachain-info", "parachains-common", "parity-scale-codec", @@ -786,6 +787,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-xcm", + "pallet-xcm-benchmarks", "parachain-info", "parachains-common", "parity-scale-codec", diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml index 1b0b6a6efe8..b6b8ce3badf 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -10,7 +10,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -hex-literal = { version = "0.3.4", optional = true } +hex-literal = { version = "0.3.4" } log = { version = "0.4.17", default-features = false } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } serde = { version = "1.0.137", optional = true, features = ["derive"] } @@ -48,6 +48,7 @@ sp-version = { git = "https://github.com/paritytech/substrate", default-features # Polkadot kusama-runtime-constants = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, optional = true } polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } @@ -123,22 +124,37 @@ std = [ ] runtime-benchmarks = [ - "hex-literal", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", - "pallet-collator-selection/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "pallet-collator-selection/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "pallet-xcm-benchmarks/runtime-benchmarks", ] try-runtime = [ + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", "frame-executive/try-runtime", - "frame-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-session/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-xcm/try-runtime", + "parachain-info/try-runtime", ] diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index 264a60ef69a..380f12d9b9d 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -10,7 +10,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -hex-literal = { version = "0.3.4", optional = true } +hex-literal = { version = "0.3.4" } log = { version = "0.4.17", default-features = false } scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } serde = { version = "1.0.137", optional = true, features = ["derive"] } @@ -48,6 +48,7 @@ sp-version = { git = "https://github.com/paritytech/substrate", default-features # Polkadot rococo-runtime-constants = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, optional = true } polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } @@ -123,22 +124,37 @@ std = [ ] runtime-benchmarks = [ - "hex-literal", "frame-benchmarking/runtime-benchmarks", "frame-support/runtime-benchmarks", - "frame-system-benchmarking", + "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", - "pallet-collator-selection/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "cumulus-pallet-session-benchmarking/runtime-benchmarks", + "pallet-collator-selection/runtime-benchmarks", "cumulus-pallet-xcmp-queue/runtime-benchmarks", + "pallet-xcm-benchmarks/runtime-benchmarks", ] try-runtime = [ + "cumulus-pallet-aura-ext/try-runtime", + "cumulus-pallet-dmp-queue/try-runtime", + "cumulus-pallet-parachain-system/try-runtime", + "cumulus-pallet-xcm/try-runtime", + "cumulus-pallet-xcmp-queue/try-runtime", "frame-executive/try-runtime", - "frame-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-session/try-runtime", + "pallet-timestamp/try-runtime", + "pallet-transaction-payment/try-runtime", + "pallet-xcm/try-runtime", + "parachain-info/try-runtime", ] diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs index 16a431d8b18..ddcd61c7fd9 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs @@ -17,15 +17,15 @@ //! Autogenerated weights for `cumulus_pallet_xcmp_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-08-09, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! DATE: 2022-11-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bkontur-ThinkPad-P14s-Gen-2i`, CPU: `11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/release/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=bridge-hub-rococo-dev // --execution=wasm // --wasm-execution=compiled // --pallet=cumulus_pallet_xcmp_queue @@ -34,7 +34,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/cumulus_pallet_xcmp_queue.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -48,13 +48,15 @@ pub struct WeightInfo(PhantomData); impl cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo { // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_u32() -> Weight { - Weight::from_ref_time(5_634_000 as u64) + // Minimum execution time: 8_474 nanoseconds. + Weight::from_ref_time(8_669_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_weight() -> Weight { - Weight::from_ref_time(5_559_000 as u64) + // Minimum execution time: 8_479 nanoseconds. + Weight::from_ref_time(8_667_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system.rs index d871fc7021f..1a63b82f6ef 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system.rs @@ -17,15 +17,15 @@ //! Autogenerated weights for `frame_system` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! DATE: 2022-11-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bkontur-ThinkPad-P14s-Gen-2i`, CPU: `11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/release/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=bridge-hub-rococo-dev // --execution=wasm // --wasm-execution=compiled // --pallet=frame_system @@ -34,57 +34,65 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/frame_system.rs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::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 { - Weight::from_ref_time(0 as u64) + fn remark(b: u32, ) -> Weight { + // Minimum execution time: 6_247 nanoseconds. + Weight::from_ref_time(11_237_657 as u64) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(332 as u64).saturating_mul(b as u64)) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event(b: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) + // Minimum execution time: 15_734 nanoseconds. + Weight::from_ref_time(16_120_000 as u64) + // Standard Error: 2 + .saturating_add(Weight::from_ref_time(1_344 as u64).saturating_mul(b as u64)) } // Storage: System Digest (r:1 w:1) // Storage: unknown [0x3a686561707061676573] (r:0 w:1) fn set_heap_pages() -> Weight { - Weight::from_ref_time(8_677_000 as u64) + // Minimum execution time: 9_746 nanoseconds. + Weight::from_ref_time(10_124_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Skipped Metadata (r:0 w:0) - /// The range of component `i` is `[1, 1000]`. + /// The range of component `i` is `[0, 1000]`. fn set_storage(i: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(625_000 as u64).saturating_mul(i as u64)) + // Minimum execution time: 4_750 nanoseconds. + Weight::from_ref_time(850_068 as u64) + // Standard Error: 1_603 + .saturating_add(Weight::from_ref_time(723_535 as u64).saturating_mul(i as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Skipped Metadata (r:0 w:0) - /// The range of component `i` is `[1, 1000]`. + /// The range of component `i` is `[0, 1000]`. fn kill_storage(i: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(554_000 as u64).saturating_mul(i as u64)) + // Minimum execution time: 4_830 nanoseconds. + Weight::from_ref_time(4_906_000 as u64) + // Standard Error: 6_196 + .saturating_add(Weight::from_ref_time(631_153 as u64).saturating_mul(i as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Skipped Metadata (r:0 w:0) - /// The range of component `p` is `[1, 1000]`. + /// The range of component `p` is `[0, 1000]`. fn kill_prefix(p: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(1_128_000 as u64).saturating_mul(p as u64)) + // Minimum execution time: 6_791 nanoseconds. + Weight::from_ref_time(6_900_000 as u64) + // Standard Error: 2_509 + .saturating_add(Weight::from_ref_time(1_169_842 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(p as u64))) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs index 8d28cb51805..7b333e5b450 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs @@ -17,15 +17,15 @@ //! Autogenerated weights for `pallet_balances` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! DATE: 2022-11-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bkontur-ThinkPad-P14s-Gen-2i`, CPU: `11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/release/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=bridge-hub-rococo-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_balances @@ -34,13 +34,13 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_balances.rs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_balances.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_balances`. @@ -48,43 +48,50 @@ pub struct WeightInfo(PhantomData); impl pallet_balances::WeightInfo for WeightInfo { // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - Weight::from_ref_time(46_411_000 as u64) + // Minimum execution time: 49_621 nanoseconds. + Weight::from_ref_time(55_026_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - Weight::from_ref_time(34_589_000 as u64) + // Minimum execution time: 48_230 nanoseconds. + Weight::from_ref_time(49_231_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn set_balance_creating() -> Weight { - Weight::from_ref_time(25_591_000 as u64) + // Minimum execution time: 27_918 nanoseconds. + Weight::from_ref_time(28_949_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn set_balance_killing() -> Weight { - Weight::from_ref_time(29_471_000 as u64) + // Minimum execution time: 31_742 nanoseconds. + Weight::from_ref_time(32_488_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:2 w:2) fn force_transfer() -> Weight { - Weight::from_ref_time(46_550_000 as u64) + // Minimum execution time: 50_107 nanoseconds. + Weight::from_ref_time(53_538_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - Weight::from_ref_time(40_804_000 as u64) + // Minimum execution time: 46_447 nanoseconds. + Weight::from_ref_time(48_606_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn force_unreserve() -> Weight { - Weight::from_ref_time(22_516_000 as u64) + // Minimum execution time: 24_816 nanoseconds. + Weight::from_ref_time(25_242_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs index 53d31d9fa2c..96d604e9308 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs @@ -17,15 +17,15 @@ //! Autogenerated weights for `pallet_collator_selection` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! DATE: 2022-11-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bkontur-ThinkPad-P14s-Gen-2i`, CPU: `11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/release/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=bridge-hub-rococo-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_collator_selection @@ -34,13 +34,13 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_collator_selection.rs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_collator_selection.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_collator_selection`. @@ -50,20 +50,23 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection Invulnerables (r:0 w:1) /// The range of component `b` is `[1, 100]`. fn set_invulnerables(b: u32, ) -> Weight { - Weight::from_ref_time(23_858_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(2_412_000 as u64).saturating_mul(b as u64)) + // Minimum execution time: 23_970 nanoseconds. + Weight::from_ref_time(34_956_823 as u64) + // Standard Error: 20_027 + .saturating_add(Weight::from_ref_time(3_044_592 as u64).saturating_mul(b as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection DesiredCandidates (r:0 w:1) fn set_desired_candidates() -> Weight { - Weight::from_ref_time(14_642_000 as u64) + // Minimum execution time: 14_973 nanoseconds. + Weight::from_ref_time(15_334_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection CandidacyBond (r:0 w:1) fn set_candidacy_bond() -> Weight { - Weight::from_ref_time(14_842_000 as u64) + // Minimum execution time: 15_445 nanoseconds. + Weight::from_ref_time(15_786_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) @@ -72,11 +75,12 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: Session NextKeys (r:1 w:0) // Storage: CollatorSelection CandidacyBond (r:1 w:0) // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) - /// The range of component `c` is `[1, 1000]`. + /// The range of component `c` is `[1, 999]`. fn register_as_candidate(c: u32, ) -> Weight { - Weight::from_ref_time(61_940_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(170_000 as u64).saturating_mul(c as u64)) + // Minimum execution time: 52_425 nanoseconds. + Weight::from_ref_time(84_745_184 as u64) + // Standard Error: 1_946 + .saturating_add(Weight::from_ref_time(207_905 as u64).saturating_mul(c as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -84,9 +88,10 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// The range of component `c` is `[6, 1000]`. fn leave_intent(c: u32, ) -> Weight { - Weight::from_ref_time(60_018_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(162_000 as u64).saturating_mul(c as u64)) + // Minimum execution time: 40_362 nanoseconds. + Weight::from_ref_time(64_131_033 as u64) + // Standard Error: 1_712 + .saturating_add(Weight::from_ref_time(212_711 as u64).saturating_mul(c as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -94,7 +99,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: System BlockWeight (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) fn note_author() -> Weight { - Weight::from_ref_time(35_100_000 as u64) + // Minimum execution time: 41_983 nanoseconds. + Weight::from_ref_time(43_013_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(4 as u64)) } @@ -105,14 +111,14 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: System BlockWeight (r:1 w:1) /// The range of component `r` is `[1, 1000]`. /// The range of component `c` is `[1, 1000]`. - fn new_session(r: u32, c: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 1_237_000 - .saturating_add(Weight::from_ref_time(6_686_000 as u64).saturating_mul(r as u64)) - // Standard Error: 1_237_000 - .saturating_add(Weight::from_ref_time(32_537_000 as u64).saturating_mul(c as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(c as u64))) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) + fn new_session(_r: u32, c: u32, ) -> Weight { + // Minimum execution time: 23_336 nanoseconds. + Weight::from_ref_time(23_770_000 as u64) + // Standard Error: 709_786 + .saturating_add(Weight::from_ref_time(25_217_185 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(c as u64))) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs index 0948531fc0e..e6c8d418250 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs @@ -17,15 +17,15 @@ //! Autogenerated weights for `pallet_session` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! DATE: 2022-11-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bkontur-ThinkPad-P14s-Gen-2i`, CPU: `11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/release/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --chain=bridge-hub-rococo-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_session @@ -34,13 +34,13 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_session.rs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_session.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_session`. @@ -49,14 +49,16 @@ impl pallet_session::WeightInfo for WeightInfo { // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:1 w:1) fn set_keys() -> Weight { - Weight::from_ref_time(23_807_000 as u64) + // Minimum execution time: 26_109 nanoseconds. + Weight::from_ref_time(26_679_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:0 w:1) fn purge_keys() -> Weight { - Weight::from_ref_time(20_676_000 as u64) + // Minimum execution time: 21_938 nanoseconds. + Weight::from_ref_time(22_493_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs index cee3e01622f..face3d0f485 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright 2021 Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -17,15 +17,15 @@ //! Autogenerated weights for `pallet_timestamp` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-07-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 +//! DATE: 2022-11-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bkontur-ThinkPad-P14s-Gen-2i`, CPU: `11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// target/release/polkadot-parachain // benchmark // pallet -// --chain=collectives-polkadot-dev +// --chain=bridge-hub-rococo-dev // --execution=wasm // --wasm-execution=compiled // --pallet=pallet_timestamp @@ -34,7 +34,7 @@ // --repeat=20 // --json // --header=./file_header.txt -// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_timestamp.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -48,11 +48,13 @@ pub struct WeightInfo(PhantomData); impl pallet_timestamp::WeightInfo for WeightInfo { // Storage: Timestamp Now (r:1 w:1) fn set() -> Weight { - Weight::from_ref_time(6_170_000 as u64) + // Minimum execution time: 9_746 nanoseconds. + Weight::from_ref_time(9_847_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } fn on_finalize() -> Weight { - Weight::from_ref_time(2_177_000 as u64) + // Minimum execution time: 4_953 nanoseconds. + Weight::from_ref_time(5_397_000 as u64) } } diff --git a/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/polkadot-parachain/src/chain_spec/bridge_hubs.rs index 59efe899f7f..7f66371d9f8 100644 --- a/polkadot-parachain/src/chain_spec/bridge_hubs.rs +++ b/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -24,12 +24,16 @@ use std::{path::PathBuf, str::FromStr}; pub enum BridgeHubRuntimeType { Rococo, RococoLocal, + // used by benchmarks + RococoDevelopment, Wococo, WococoLocal, Kusama, KusamaLocal, + // used by benchmarks + KusamaDevelopment, } impl FromStr for BridgeHubRuntimeType { @@ -39,8 +43,10 @@ impl FromStr for BridgeHubRuntimeType { match value { kusama::BRIDGE_HUB_KUSAMA => Ok(BridgeHubRuntimeType::Kusama), kusama::BRIDGE_HUB_KUSAMA_LOCAL => Ok(BridgeHubRuntimeType::KusamaLocal), + kusama::BRIDGE_HUB_KUSAMA_DEVELOPMENT => Ok(BridgeHubRuntimeType::KusamaDevelopment), rococo::BRIDGE_HUB_ROCOCO => Ok(BridgeHubRuntimeType::Rococo), rococo::BRIDGE_HUB_ROCOCO_LOCAL => Ok(BridgeHubRuntimeType::RococoLocal), + rococo::BRIDGE_HUB_ROCOCO_DEVELOPMENT => Ok(BridgeHubRuntimeType::RococoDevelopment), wococo::BRIDGE_HUB_WOCOCO => Ok(BridgeHubRuntimeType::Wococo), wococo::BRIDGE_HUB_WOCOCO_LOCAL => Ok(BridgeHubRuntimeType::WococoLocal), _ => Err(format!("Value '{}' is not configured yet", value)), @@ -53,9 +59,13 @@ impl BridgeHubRuntimeType { pub fn chain_spec_from_json_file(&self, path: PathBuf) -> Result, String> { match self { - BridgeHubRuntimeType::Kusama | BridgeHubRuntimeType::KusamaLocal => + BridgeHubRuntimeType::Kusama | + BridgeHubRuntimeType::KusamaLocal | + BridgeHubRuntimeType::KusamaDevelopment => Ok(Box::new(kusama::BridgeHubChainSpec::from_json_file(path)?)), - BridgeHubRuntimeType::Rococo | BridgeHubRuntimeType::RococoLocal => + BridgeHubRuntimeType::Rococo | + BridgeHubRuntimeType::RococoLocal | + BridgeHubRuntimeType::RococoDevelopment => Ok(Box::new(rococo::BridgeHubChainSpec::from_json_file(path)?)), BridgeHubRuntimeType::Wococo | BridgeHubRuntimeType::WococoLocal => Ok(Box::new(wococo::BridgeHubChainSpec::from_json_file(path)?)), @@ -74,6 +84,12 @@ impl BridgeHubRuntimeType { "kusama-local", ParaId::new(1003), ))), + BridgeHubRuntimeType::KusamaDevelopment => Ok(Box::new(kusama::local_config( + kusama::BRIDGE_HUB_KUSAMA_DEVELOPMENT, + "Kusama BrideHub Development", + "kusama-dev", + ParaId::new(1003), + ))), BridgeHubRuntimeType::Rococo => Ok(Box::new(rococo::live_config( rococo::BRIDGE_HUB_ROCOCO, "Rococo BrideHub", @@ -88,6 +104,13 @@ impl BridgeHubRuntimeType { ParaId::new(1013), |_| (), ))), + BridgeHubRuntimeType::RococoDevelopment => Ok(Box::new(rococo::local_config( + rococo::BRIDGE_HUB_ROCOCO_DEVELOPMENT, + "Rococo BrideHub Development", + "rococo-dev", + ParaId::new(1013), + |_| (), + ))), BridgeHubRuntimeType::Wococo => Ok(Box::new(wococo::live_config( wococo::BRIDGE_HUB_WOCOCO, "Wococo BrideHub", @@ -105,11 +128,13 @@ impl BridgeHubRuntimeType { pub fn runtime_version(&self) -> &'static RuntimeVersion { match self { - BridgeHubRuntimeType::Kusama | BridgeHubRuntimeType::KusamaLocal => - &bridge_hub_kusama_runtime::VERSION, + BridgeHubRuntimeType::Kusama | + BridgeHubRuntimeType::KusamaLocal | + BridgeHubRuntimeType::KusamaDevelopment => &bridge_hub_kusama_runtime::VERSION, BridgeHubRuntimeType::Rococo | - BridgeHubRuntimeType::Wococo | BridgeHubRuntimeType::RococoLocal | + BridgeHubRuntimeType::RococoDevelopment | + BridgeHubRuntimeType::Wococo | BridgeHubRuntimeType::WococoLocal => { // this is intentional, for Rococo/Wococo we just want to have one runtime, which is configured for both sides &bridge_hub_rococo_runtime::VERSION @@ -143,6 +168,7 @@ pub mod rococo { pub(crate) const BRIDGE_HUB_ROCOCO: &str = "bridge-hub-rococo"; pub(crate) const BRIDGE_HUB_ROCOCO_LOCAL: &str = "bridge-hub-rococo-local"; + pub(crate) const BRIDGE_HUB_ROCOCO_DEVELOPMENT: &str = "bridge-hub-rococo-dev"; const BRIDGE_HUB_ROCOCO_ED: bridge_hub_rococo_runtime::Balance = bridge_hub_rococo_runtime::constants::currency::EXISTENTIAL_DEPOSIT; @@ -358,6 +384,7 @@ pub mod kusama { pub(crate) const BRIDGE_HUB_KUSAMA: &str = "bridge-hub-kusama"; pub(crate) const BRIDGE_HUB_KUSAMA_LOCAL: &str = "bridge-hub-kusama-local"; + pub(crate) const BRIDGE_HUB_KUSAMA_DEVELOPMENT: &str = "bridge-hub-kusama-dev"; const BRIDGE_HUB_KUSAMA_ED: bridge_hub_kusama_runtime::Balance = bridge_hub_kusama_runtime::constants::currency::EXISTENTIAL_DEPOSIT; diff --git a/polkadot-parachain/src/command.rs b/polkadot-parachain/src/command.rs index ad828318d51..7cace3ba0c7 100644 --- a/polkadot-parachain/src/command.rs +++ b/polkadot-parachain/src/command.rs @@ -18,8 +18,9 @@ use crate::{ chain_spec, cli::{Cli, RelayChainCli, Subcommand}, service::{ - new_partial, Block, CollectivesPolkadotRuntimeExecutor, StatemineRuntimeExecutor, - StatemintRuntimeExecutor, WestmintRuntimeExecutor, + new_partial, Block, BridgeHubKusamaRuntimeExecutor, BridgeHubRococoRuntimeExecutor, + CollectivesPolkadotRuntimeExecutor, StatemineRuntimeExecutor, StatemintRuntimeExecutor, + WestmintRuntimeExecutor, }, }; use codec::Encode; @@ -479,7 +480,8 @@ macro_rules! construct_async_run { Runtime::BridgeHub(bridge_hub_runtime_type) => { match bridge_hub_runtime_type { chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama | - chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaLocal => { + chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaLocal | + chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaDevelopment => { runner.async_run(|$config| { let $components = new_partial::( &$config, @@ -491,7 +493,8 @@ macro_rules! construct_async_run { }) }, chain_spec::bridge_hubs::BridgeHubRuntimeType::Rococo | - chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal => { + chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal | + chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoDevelopment => { runner.async_run(|$config| { let $components = new_partial::( &$config, @@ -606,7 +609,8 @@ pub fn run() -> Result<()> { match cmd { BenchmarkCmd::Pallet(cmd) => if cfg!(feature = "runtime-benchmarks") { - runner.sync_run(|config| match config.chain_spec.runtime() { + runner.sync_run(|config| { + match config.chain_spec.runtime() { Runtime::Statemine => cmd.run::(config), Runtime::Westmint => cmd.run::(config), @@ -614,11 +618,28 @@ pub fn run() -> Result<()> { cmd.run::(config), Runtime::CollectivesPolkadot | Runtime::CollectivesWestend => cmd.run::(config), + Runtime::BridgeHub(bridge_hub_runtime_type) => match bridge_hub_runtime_type { + chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama | + chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaLocal | + chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaDevelopment => + cmd.run::(config), + chain_spec::bridge_hubs::BridgeHubRuntimeType::Rococo | + chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal | + chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoDevelopment => + cmd.run::(config), + _ => Err(format!( + "Chain '{:?}' doesn't support benchmarking for bridge_hub_runtime_type: {:?}", + config.chain_spec.runtime(), + bridge_hub_runtime_type + ) + .into()), + } _ => Err(format!( "Chain '{:?}' doesn't support benchmarking", config.chain_spec.runtime() ) .into()), + } }) } else { Err("Benchmarking wasn't enabled when building the node. \ @@ -679,6 +700,32 @@ pub fn run() -> Result<()> { task_manager, )) }), + Runtime::BridgeHub(bridge_hub_runtime_type) => match bridge_hub_runtime_type { + chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama | + chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaLocal | + chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaDevelopment => + runner.async_run(|config| { + Ok(( + cmd.run::(config), + task_manager, + )) + }), + chain_spec::bridge_hubs::BridgeHubRuntimeType::Rococo | + chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal | + chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoDevelopment => + runner.async_run(|config| { + Ok(( + cmd.run::(config), + task_manager, + )) + }), + _ => Err(format!( + "Chain '{:?}' doesn't support try-runtime for bridge_hub_runtime_type: {:?}", + config.chain_spec.runtime(), + bridge_hub_runtime_type + ) + .into()), + }, Runtime::Shell => runner.async_run(|config| { Ok(( cmd.run::(config), @@ -801,7 +848,8 @@ pub fn run() -> Result<()> { .map_err(Into::into), Runtime::BridgeHub(bridge_hub_runtime_type) => match bridge_hub_runtime_type { chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama | - chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaLocal => + chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaLocal | + chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaDevelopment => crate::service::start_generic_aura_node::< chain_spec::bridge_hubs::kusama::RuntimeApi, AuraId, @@ -809,7 +857,8 @@ pub fn run() -> Result<()> { .await .map(|r| r.0), chain_spec::bridge_hubs::BridgeHubRuntimeType::Rococo | - chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal => + chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoLocal | + chain_spec::bridge_hubs::BridgeHubRuntimeType::RococoDevelopment => crate::service::start_generic_aura_node::< chain_spec::bridge_hubs::rococo::RuntimeApi, AuraId, diff --git a/polkadot-parachain/src/service.rs b/polkadot-parachain/src/service.rs index cba3fbdfb35..f5274c3a853 100644 --- a/polkadot-parachain/src/service.rs +++ b/polkadot-parachain/src/service.rs @@ -150,6 +150,36 @@ impl sc_executor::NativeExecutionDispatch for CollectivesPolkadotRuntimeExecutor } } +// Native BridgeHubKusama executor instance. +pub struct BridgeHubKusamaRuntimeExecutor; + +impl sc_executor::NativeExecutionDispatch for BridgeHubKusamaRuntimeExecutor { + type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; + + fn dispatch(method: &str, data: &[u8]) -> Option> { + bridge_hub_kusama_runtime::api::dispatch(method, data) + } + + fn native_version() -> sc_executor::NativeVersion { + bridge_hub_kusama_runtime::native_version() + } +} + +// Native BridgeHubRococo executor instance. +pub struct BridgeHubRococoRuntimeExecutor; + +impl sc_executor::NativeExecutionDispatch for BridgeHubRococoRuntimeExecutor { + type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; + + fn dispatch(method: &str, data: &[u8]) -> Option> { + bridge_hub_rococo_runtime::api::dispatch(method, data) + } + + fn native_version() -> sc_executor::NativeVersion { + bridge_hub_rococo_runtime::native_version() + } +} + /// Starts a `ServiceBuilder` for a full service. /// /// Use this macro if you don't actually need the full service, but just the builder in order to diff --git a/scripts/benchmarks-ci.sh b/scripts/benchmarks-ci.sh index da4318a3519..2302d184766 100755 --- a/scripts/benchmarks-ci.sh +++ b/scripts/benchmarks-ci.sh @@ -39,6 +39,15 @@ elif [[ $runtimeName == "collectives-polkadot" ]]; then cumulus_pallet_xcmp_queue frame_system ) +elif [[ $runtimeName == "bridge-hub-rococo" ]] || [[ $runtimeName == "bridge-hub-kusama" ]]; then + pallets=( + frame_system + pallet_balances + pallet_session + pallet_timestamp + pallet_collator_selection + cumulus_pallet_xcmp_queue + ) else echo "$runtimeName pallet list not found in benchmarks-ci.sh" exit 1 diff --git a/scripts/benchmarks.sh b/scripts/benchmarks.sh index 0dd9544f56d..0ac2c3b74b4 100755 --- a/scripts/benchmarks.sh +++ b/scripts/benchmarks.sh @@ -7,3 +7,6 @@ ${__dir}/benchmarks-ci.sh collectives collectives-polkadot target/production ${__dir}/benchmarks-ci.sh assets statemine target/production ${__dir}/benchmarks-ci.sh assets statemint target/production ${__dir}/benchmarks-ci.sh assets westmint target/production + +${__dir}/benchmarks-ci.sh bridge-hubs bridge-hub-kusama target/production +${__dir}/benchmarks-ci.sh bridge-hubs bridge-hub-rococo target/production diff --git a/test/runtime/src/lib.rs b/test/runtime/src/lib.rs index 45bebbbcdd4..4e1df1b70bd 100644 --- a/test/runtime/src/lib.rs +++ b/test/runtime/src/lib.rs @@ -48,7 +48,7 @@ pub use frame_support::{ construct_runtime, dispatch::DispatchClass, parameter_types, - traits::{ConstU64, ConstU8, Randomness}, + traits::{ConstU8, Randomness}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, ConstantMultiplier, IdentityFee, Weight, @@ -209,11 +209,15 @@ impl frame_system::Config for Runtime { type MaxConsumers = frame_support::traits::ConstU32<16>; } +parameter_types! { + pub const MinimumPeriod: u64 = SLOT_DURATION / 2; +} + impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = (); - type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; + type MinimumPeriod = MinimumPeriod; type WeightInfo = (); } From fe88ad0e1d2efd3a7c1e25918a4eb20b63b5a673 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 16 Nov 2022 15:58:54 +0100 Subject: [PATCH 17/39] Fixes CI --- polkadot-parachain/src/command.rs | 2 +- scripts/ci/changelog/bin/changelog | 12 ++++++++++-- scripts/ci/gitlab/pipeline/build.yml | 13 +++++++++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/polkadot-parachain/src/command.rs b/polkadot-parachain/src/command.rs index 7cace3ba0c7..c5166401a3d 100644 --- a/polkadot-parachain/src/command.rs +++ b/polkadot-parachain/src/command.rs @@ -721,7 +721,7 @@ pub fn run() -> Result<()> { }), _ => Err(format!( "Chain '{:?}' doesn't support try-runtime for bridge_hub_runtime_type: {:?}", - config.chain_spec.runtime(), + runner.config().chain_spec.runtime(), bridge_hub_runtime_type ) .into()), diff --git a/scripts/ci/changelog/bin/changelog b/scripts/ci/changelog/bin/changelog index 1f3de939d0a..ac4c42d2cbc 100755 --- a/scripts/ci/changelog/bin/changelog +++ b/scripts/ci/changelog/bin/changelog @@ -81,6 +81,8 @@ SHELL_DIGEST = ENV['SHELL_DIGEST'] || 'digests/shell-srtool-digest.json' WESTMINT_DIGEST = ENV['WESTMINT_DIGEST'] || 'digests/westmint-srtool-digest.json' STATEMINE_DIGEST = ENV['STATEMINE_DIGEST'] || 'digests/statemine-srtool-digest.json' STATEMINT_DIGEST = ENV['STATEMINT_DIGEST'] || 'digests/statemint-srtool-digest.json' +BRIDGE_HUB_ROCOCO_DIGEST = ENV['BRIDGE_HUB_ROCOCO_DIGEST'] || 'digests/bridge-hub-rococo-srtool-digest.json' +BRIDGE_HUB_KUSAMA_DIGEST = ENV['BRIDGE_HUB_KUSAMA_DIGEST'] || 'digests/bridge-hub-kusama-srtool-digest.json' ROCOCO_PARA_DIGEST = ENV['ROCOCO_PARA_DIGEST'] || 'digests/rococo-parachain-srtool-digest.json' CANVAS_KUSAMA_DIGEST = ENV['CANVAS_KUSAMA_DIGEST'] || 'digests/contracts-rococo-srtool-digest.json' @@ -114,6 +116,8 @@ else --slurpfile srtool_rococo_parachain %s \ --slurpfile srtool_contracts_rococo %s \ --slurpfile srtool_polkadot_collectives %s \ + --slurpfile srtool_bridge_hub_rococo %s \ + --slurpfile srtool_bridge_hub_kusama %s \ -n \'{ cumulus: $cumulus[0], substrate: $substrate[0], @@ -125,7 +129,9 @@ else { name: "statemint", data: $srtool_statemint[0] }, { name: "rococo", data: $srtool_rococo_parachain[0] }, { name: "contracts", data: $srtool_contracts_rococo[0] }, - { name: "polkadot-collectives", data: $srtool_polkadot_collectives[0] } + { name: "polkadot-collectives", data: $srtool_polkadot_collectives[0] }, + { name: "bridge-hub-rococo", data: $srtool_bridge_hub_rococo[0] }, + { name: "bridge-hub-kusama", data: $srtool_bridge_hub_kusama[0] } ] }\' > context.json', cumulus_data, substrate_data, @@ -136,7 +142,9 @@ else STATEMINT_DIGEST, ROCOCO_PARA_DIGEST, CANVAS_KUSAMA_DIGEST, - POLKADOT_COLLECTIVES_DIGEST + POLKADOT_COLLECTIVES_DIGEST, + BRIDGE_HUB_ROCOCO_DIGEST, + BRIDGE_HUB_KUSAMA_DIGEST ) end system(cmd) diff --git a/scripts/ci/gitlab/pipeline/build.yml b/scripts/ci/gitlab/pipeline/build.yml index 86081e6a46a..ef304577be1 100644 --- a/scripts/ci/gitlab/pipeline/build.yml +++ b/scripts/ci/gitlab/pipeline/build.yml @@ -69,8 +69,8 @@ build-test-parachain: cd ..; done -# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-contracts -# DAG: build-runtime-assets ->build-runtime-starters -> build-runtime-testing +# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-bridge-hubs -> build-runtime-contracts +# DAG: build-runtime-assets -> build-runtime-starters -> build-runtime-testing build-runtime-assets: <<: *build-runtime-template variables: @@ -85,6 +85,15 @@ build-runtime-collectives: - job: build-runtime-assets artifacts: false +build-runtime-bridge-hubs: + <<: *build-runtime-template + variables: + RUNTIME_PATH: "parachains/runtimes/bridge-hubs" + # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs + needs: + - job: build-runtime-collectives + artifacts: false + build-runtime-contracts: <<: *build-runtime-template variables: From 6ccdbf8600277cc15d4595242746b2b3f1c5e7d4 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 16 Nov 2022 16:42:15 +0100 Subject: [PATCH 18/39] Fixes --- parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml | 1 + parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml index b6b8ce3badf..6d8e1f669d1 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -103,6 +103,7 @@ std = [ "pallet-transaction-payment/std", "pallet-xcm/std", "parachain-info/std", + "parachains-common/std", "polkadot-core-primitives/std", "polkadot-parachain/std", "polkadot-runtime-common/std", diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index 380f12d9b9d..d1545396f28 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -102,6 +102,7 @@ std = [ "pallet-transaction-payment/std", "pallet-xcm/std", "parachain-info/std", + "parachains-common/std", "polkadot-core-primitives/std", "polkadot-parachain/std", "polkadot-runtime-common/std", From 4bb3eff02c1729e34056f6b23dc6cbf72d5da46e Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Wed, 16 Nov 2022 16:48:04 +0000 Subject: [PATCH 19/39] ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs frame_system --- .../src/weights/frame_system.rs | 65 +++++++++++-------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/frame_system.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/frame_system.rs index d871fc7021f..54e93dbbb07 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/frame_system.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/frame_system.rs @@ -17,74 +17,83 @@ //! Autogenerated weights for `frame_system` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! DATE: 2022-11-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// /home/benchbot/cargo_target_dir/production/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=frame_system -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=bridge-hub-kusama-dev // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/frame_system.rs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::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 { - Weight::from_ref_time(0 as u64) + fn remark(b: u32, ) -> Weight { + // Minimum execution time: 4_164 nanoseconds. + Weight::from_ref_time(149_826 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(411 as u64).saturating_mul(b as u64)) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event(b: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) + // Minimum execution time: 13_916 nanoseconds. + Weight::from_ref_time(14_216_000 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) + .saturating_add(Weight::from_ref_time(1_482 as u64).saturating_mul(b as u64)) } // Storage: System Digest (r:1 w:1) // Storage: unknown [0x3a686561707061676573] (r:0 w:1) fn set_heap_pages() -> Weight { - Weight::from_ref_time(8_677_000 as u64) + // Minimum execution time: 8_909 nanoseconds. + Weight::from_ref_time(9_270_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Skipped Metadata (r:0 w:0) - /// The range of component `i` is `[1, 1000]`. + /// The range of component `i` is `[0, 1000]`. fn set_storage(i: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(625_000 as u64).saturating_mul(i as u64)) + // Minimum execution time: 4_203 nanoseconds. + Weight::from_ref_time(4_300_000 as u64) + // Standard Error: 816 + .saturating_add(Weight::from_ref_time(626_283 as u64).saturating_mul(i as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Skipped Metadata (r:0 w:0) - /// The range of component `i` is `[1, 1000]`. + /// The range of component `i` is `[0, 1000]`. fn kill_storage(i: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(554_000 as u64).saturating_mul(i as u64)) + // Minimum execution time: 4_136 nanoseconds. + Weight::from_ref_time(4_228_000 as u64) + // Standard Error: 997 + .saturating_add(Weight::from_ref_time(544_821 as u64).saturating_mul(i as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64))) } // Storage: Skipped Metadata (r:0 w:0) - /// The range of component `p` is `[1, 1000]`. + /// The range of component `p` is `[0, 1000]`. fn kill_prefix(p: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(1_128_000 as u64).saturating_mul(p as u64)) + // Minimum execution time: 5_927 nanoseconds. + Weight::from_ref_time(6_026_000 as u64) + // Standard Error: 1_393 + .saturating_add(Weight::from_ref_time(1_129_967 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(p as u64))) } } From 93ca6e2694943870814cb9336915133beacefa6b Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Wed, 16 Nov 2022 17:13:58 +0000 Subject: [PATCH 20/39] ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_collator_selection --- .../src/weights/pallet_collator_selection.rs | 71 ++++++++++--------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs index 53d31d9fa2c..acfa3d23568 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs @@ -17,30 +17,31 @@ //! Autogenerated weights for `pallet_collator_selection` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! DATE: 2022-11-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// /home/benchbot/cargo_target_dir/production/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_collator_selection -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=bridge-hub-kusama-dev // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_collator_selection.rs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_collator_selection`. @@ -50,20 +51,23 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection Invulnerables (r:0 w:1) /// The range of component `b` is `[1, 100]`. fn set_invulnerables(b: u32, ) -> Weight { - Weight::from_ref_time(23_858_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(2_412_000 as u64).saturating_mul(b as u64)) + // Minimum execution time: 23_238 nanoseconds. + Weight::from_ref_time(24_641_033 as u64) + // Standard Error: 2_887 + .saturating_add(Weight::from_ref_time(2_458_746 as u64).saturating_mul(b as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection DesiredCandidates (r:0 w:1) fn set_desired_candidates() -> Weight { - Weight::from_ref_time(14_642_000 as u64) + // Minimum execution time: 14_081 nanoseconds. + Weight::from_ref_time(14_559_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection CandidacyBond (r:0 w:1) fn set_candidacy_bond() -> Weight { - Weight::from_ref_time(14_842_000 as u64) + // Minimum execution time: 14_048 nanoseconds. + Weight::from_ref_time(14_542_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) @@ -72,11 +76,12 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: Session NextKeys (r:1 w:0) // Storage: CollatorSelection CandidacyBond (r:1 w:0) // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) - /// The range of component `c` is `[1, 1000]`. + /// The range of component `c` is `[1, 999]`. fn register_as_candidate(c: u32, ) -> Weight { - Weight::from_ref_time(61_940_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(170_000 as u64).saturating_mul(c as u64)) + // Minimum execution time: 49_022 nanoseconds. + Weight::from_ref_time(65_830_450 as u64) + // Standard Error: 1_134 + .saturating_add(Weight::from_ref_time(166_499 as u64).saturating_mul(c as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -84,9 +89,10 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// The range of component `c` is `[6, 1000]`. fn leave_intent(c: u32, ) -> Weight { - Weight::from_ref_time(60_018_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(162_000 as u64).saturating_mul(c as u64)) + // Minimum execution time: 39_176 nanoseconds. + Weight::from_ref_time(60_721_956 as u64) + // Standard Error: 1_415 + .saturating_add(Weight::from_ref_time(158_944 as u64).saturating_mul(c as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -94,7 +100,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: System BlockWeight (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) fn note_author() -> Weight { - Weight::from_ref_time(35_100_000 as u64) + // Minimum execution time: 36_710 nanoseconds. + Weight::from_ref_time(37_440_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(4 as u64)) } @@ -105,14 +112,14 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: System BlockWeight (r:1 w:1) /// The range of component `r` is `[1, 1000]`. /// The range of component `c` is `[1, 1000]`. - fn new_session(r: u32, c: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 1_237_000 - .saturating_add(Weight::from_ref_time(6_686_000 as u64).saturating_mul(r as u64)) - // Standard Error: 1_237_000 - .saturating_add(Weight::from_ref_time(32_537_000 as u64).saturating_mul(c as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(c as u64))) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) + fn new_session(_r: u32, c: u32, ) -> Weight { + // Minimum execution time: 22_483 nanoseconds. + Weight::from_ref_time(22_818_000 as u64) + // Standard Error: 630_790 + .saturating_add(Weight::from_ref_time(22_103_331 as u64).saturating_mul(c as u64)) + .saturating_add(T::DbWeight::get().reads(4 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(c as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(c as u64))) } } From 9c608dcc0f03549f602cc074d8808f5cbbe146e2 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Wed, 16 Nov 2022 17:32:40 +0000 Subject: [PATCH 21/39] ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_balances --- .../src/weights/pallet_balances.rs | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs index 8d28cb51805..957068da884 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_balances.rs @@ -17,30 +17,31 @@ //! Autogenerated weights for `pallet_balances` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! DATE: 2022-11-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// /home/benchbot/cargo_target_dir/production/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_balances -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=bridge-hub-kusama-dev // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_balances.rs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_balances`. @@ -48,43 +49,50 @@ pub struct WeightInfo(PhantomData); impl pallet_balances::WeightInfo for WeightInfo { // Storage: System Account (r:1 w:1) fn transfer() -> Weight { - Weight::from_ref_time(46_411_000 as u64) + // Minimum execution time: 47_645 nanoseconds. + Weight::from_ref_time(48_382_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn transfer_keep_alive() -> Weight { - Weight::from_ref_time(34_589_000 as u64) + // Minimum execution time: 35_350 nanoseconds. + Weight::from_ref_time(36_529_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn set_balance_creating() -> Weight { - Weight::from_ref_time(25_591_000 as u64) + // Minimum execution time: 26_899 nanoseconds. + Weight::from_ref_time(27_319_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn set_balance_killing() -> Weight { - Weight::from_ref_time(29_471_000 as u64) + // Minimum execution time: 30_564 nanoseconds. + Weight::from_ref_time(30_989_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:2 w:2) fn force_transfer() -> Weight { - Weight::from_ref_time(46_550_000 as u64) + // Minimum execution time: 46_943 nanoseconds. + Weight::from_ref_time(47_553_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: System Account (r:1 w:1) fn transfer_all() -> Weight { - Weight::from_ref_time(40_804_000 as u64) + // Minimum execution time: 41_889 nanoseconds. + Weight::from_ref_time(42_678_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: System Account (r:1 w:1) fn force_unreserve() -> Weight { - Weight::from_ref_time(22_516_000 as u64) + // Minimum execution time: 23_742 nanoseconds. + Weight::from_ref_time(24_114_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } From f22b102f70e742df73e7869b7b8e776d7335e3bd Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Wed, 16 Nov 2022 21:06:10 +0000 Subject: [PATCH 22/39] ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_session --- .../src/weights/pallet_session.rs | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs index 0948531fc0e..9a154259864 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_session.rs @@ -17,30 +17,31 @@ //! Autogenerated weights for `pallet_session` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! DATE: 2022-11-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// /home/benchbot/cargo_target_dir/production/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_session -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=bridge-hub-kusama-dev // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights/pallet_session.rs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_session`. @@ -49,14 +50,16 @@ impl pallet_session::WeightInfo for WeightInfo { // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:1 w:1) fn set_keys() -> Weight { - Weight::from_ref_time(23_807_000 as u64) + // Minimum execution time: 24_317 nanoseconds. + Weight::from_ref_time(24_916_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Session NextKeys (r:1 w:1) // Storage: Session KeyOwner (r:0 w:1) fn purge_keys() -> Weight { - Weight::from_ref_time(20_676_000 as u64) + // Minimum execution time: 20_669 nanoseconds. + Weight::from_ref_time(21_181_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } From eb7659d4ea781762e68a74e124be4cb094c93da3 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 16 Nov 2022 21:53:46 +0100 Subject: [PATCH 23/39] Fixes name --- polkadot-parachain/src/chain_spec/bridge_hubs.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/polkadot-parachain/src/chain_spec/bridge_hubs.rs index 7f66371d9f8..1431eb0a0e7 100644 --- a/polkadot-parachain/src/chain_spec/bridge_hubs.rs +++ b/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -80,46 +80,46 @@ impl BridgeHubRuntimeType { )?)), BridgeHubRuntimeType::KusamaLocal => Ok(Box::new(kusama::local_config( kusama::BRIDGE_HUB_KUSAMA_LOCAL, - "Kusama BrideHub Local", + "Kusama BridgeHub Local", "kusama-local", ParaId::new(1003), ))), BridgeHubRuntimeType::KusamaDevelopment => Ok(Box::new(kusama::local_config( kusama::BRIDGE_HUB_KUSAMA_DEVELOPMENT, - "Kusama BrideHub Development", + "Kusama BridgeHub Development", "kusama-dev", ParaId::new(1003), ))), BridgeHubRuntimeType::Rococo => Ok(Box::new(rococo::live_config( rococo::BRIDGE_HUB_ROCOCO, - "Rococo BrideHub", + "Rococo BridgeHub", "rococo", ParaId::new(1013), |_| (), ))), BridgeHubRuntimeType::RococoLocal => Ok(Box::new(rococo::local_config( rococo::BRIDGE_HUB_ROCOCO_LOCAL, - "Rococo BrideHub Local", + "Rococo BridgeHub Local", "rococo-local", ParaId::new(1013), |_| (), ))), BridgeHubRuntimeType::RococoDevelopment => Ok(Box::new(rococo::local_config( rococo::BRIDGE_HUB_ROCOCO_DEVELOPMENT, - "Rococo BrideHub Development", + "Rococo BridgeHub Development", "rococo-dev", ParaId::new(1013), |_| (), ))), BridgeHubRuntimeType::Wococo => Ok(Box::new(wococo::live_config( wococo::BRIDGE_HUB_WOCOCO, - "Wococo BrideHub", + "Wococo BridgeHub", "wococo", ParaId::new(1013), ))), BridgeHubRuntimeType::WococoLocal => Ok(Box::new(wococo::local_config( wococo::BRIDGE_HUB_WOCOCO_LOCAL, - "Wococo BrideHub Local", + "Wococo BridgeHub Local", "wococo-local", ParaId::new(1013), ))), From 08017fbf5559bf003526b19203cb3157a2255969 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 16 Nov 2022 22:06:09 +0100 Subject: [PATCH 24/39] Fixes readme --- parachains/runtimes/bridge-hubs/README.md | 32 ++++++++++++++++++ .../docs/bridge-hub-parachain-design.jpg | Bin 0 -> 88324 bytes 2 files changed, 32 insertions(+) create mode 100644 parachains/runtimes/bridge-hubs/README.md create mode 100644 parachains/runtimes/bridge-hubs/docs/bridge-hub-parachain-design.jpg diff --git a/parachains/runtimes/bridge-hubs/README.md b/parachains/runtimes/bridge-hubs/README.md new file mode 100644 index 00000000000..9b371c639f9 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/README.md @@ -0,0 +1,32 @@ +# Bridge-hubs Parachain + +Implementation of _BridgeHub_, a blockchain to support message passing between Substrate based chains like Polkadot and Kusama networks. + +_BridgeHub_ allows users to: + +- Passing arbitrary messages between different Substrate chains (Polkadot <-> Kusama). + -- Message passing is + +_BridgeHub_ is meant to be **_system parachain_** with main responsibilities: +- sync finality proofs between relay chains +- sync finality proofs between BridgeHub parachains +- pass (XCM) messages between different BridgeHub parachains + +![](./docs/bridge-hub-parachain-design.jpg "Basic deployment setup") + +## How to try locally +``` +cd +cargo build --release -p polkadot-parachain@0.9.320 + +# script expect to have pre-built polkadot binary on the path: ../polkadot/target/release/polkadot +# if using kusama-local, build polkadot with `--features fast-runtime` + +# BridgeHubRococo +zombienet-linux --provider native spawn ./zombienet/examples/bridge_hub_rococo_local_network.toml + +# or + +# BridgeHubKusama +zombienet-linux --provider native spawn ./zombienet/examples/bridge_hub_kusama_local_network.toml +``` diff --git a/parachains/runtimes/bridge-hubs/docs/bridge-hub-parachain-design.jpg b/parachains/runtimes/bridge-hubs/docs/bridge-hub-parachain-design.jpg new file mode 100644 index 0000000000000000000000000000000000000000..02feb11e10175b1357835e12b6d3e756032c9aa6 GIT binary patch literal 88324 zcmd431yr5A(kQ%fclSb(qQxohUfkW?y*LF5#ogWAt++#RcPs7`ibH|Bsl7+ObME=> z_usqz?6vkYnM{&-CdtfXlJz{zKYalpONfYz06;)M0J^{*;AsgU2!Mu!go1>ChJu2E zfq{mFM@N8%gM-IGMMFX-z$GFiz{SUZK}tvQf`sNJKK?5CfWW}Oz{9~~BOqWi65|sy{Vx041@##iUI%-{JwLsO4`UmJnD;}@)9_BQdF5p5d$dy3C9=4WC!un9TP=FEUcz^MX zmC74)q+rW)#Z7nSnkDjL%8$Q-A1X-L{XAK)X+FTr^j6EW*gfj=-0WJ72INU?bByV3 zwKI`xf}}SBiHgkFJS)X`y6ms^e>}QVAe~b7OMRX*xL#FOxQPzBq3tH?WySK>VVcR> zgV+V?Ec0i0oQrBXgh+`N7S42zs~L5{TA>a#3o`v>!eb>xbwsQewzDTzG`$4eNqMxe zO(=(i_;I2dxh5`+nOqQ@;|39}oQDo1X%MjNePkuz*Q=u8n*Dn*#Vm3Y?9I_I7$DAdC^RK^=y)0AUJlmb%@n7WoT@&0*q2aC6 z8Lce;LNTdpHL+18#j7B7ZtU^J!Ekry>;Y`+ys(CrYNV16A6na9%+BMko*v;mi~e@p z;>GV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;4Vaf5$tkAdu;k>=4HM?MNC3kOaGhvK0c@Dx-XDCk?0d#j=M$CInbUFIC(G@@93S4 zVrQnPKoNO$hpS%zgY)P_8BPUYta>4Y;&CWdW|65gifhwkTx)pb2dFZJ8zx))&=|!4 z4QwqQ*~-maJ7=O8Jt3i5Ey0RGN`nmW^RRYEMRxQcoK{Zx5j6f7FGn;QYS}e-$H^xF z1d#Tx`G1cvbnLu5*NGhu9TlX1o$ukW7@Gg%8|%NAcMy~$@=@lO!uuLS|7pbs;jI8P z-J5_~0@gmi-PSn$Mb#1=BkCJZ^BJdRG=X;0=GT}#)U|Fvuv>*N%>9OY1^Do-xxQ}2 z$RG?@`NuJrj_!OY*E^xBtZD-LvQIq{_|FOaeC}=?$SxlIIb$pPt70TqyjI2q-8ntG z@6$Ec5U0#_wl#jQ`s<}0zxNVBrt7xXJdtZI*IcL;3Y=_q;p;iPxs!JKD7X2Xt5HS7 zN<%1hExd79Y9xm)q$suAxpBwy)c!j%!@KBsE%M9$WOG?rRD?L`X6`-Jov(GhK6?uL zmtWVpteGvvQFj=+eJcEhEf%${o Date: Wed, 16 Nov 2022 21:26:28 +0000 Subject: [PATCH 25/39] ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_timestamp --- .../src/weights/pallet_timestamp.rs | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs index cee3e01622f..8d1962fac6f 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_timestamp.rs @@ -1,4 +1,4 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. +// Copyright 2021 Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -17,24 +17,25 @@ //! Autogenerated weights for `pallet_timestamp` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-07-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 +//! DATE: 2022-11-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// /home/benchbot/cargo_target_dir/production/polkadot-parachain // benchmark // pallet -// --chain=collectives-polkadot-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_timestamp -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=bridge-hub-kusama-dev // --header=./file_header.txt -// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -48,11 +49,13 @@ pub struct WeightInfo(PhantomData); impl pallet_timestamp::WeightInfo for WeightInfo { // Storage: Timestamp Now (r:1 w:1) fn set() -> Weight { - Weight::from_ref_time(6_170_000 as u64) + // Minimum execution time: 8_019 nanoseconds. + Weight::from_ref_time(8_317_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } fn on_finalize() -> Weight { - Weight::from_ref_time(2_177_000 as u64) + // Minimum execution time: 4_248 nanoseconds. + Weight::from_ref_time(4_485_000 as u64) } } From e090afb822776d386dff33dbf87c232de341df8c Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Wed, 16 Nov 2022 21:51:38 +0000 Subject: [PATCH 26/39] ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs cumulus_pallet_xcmp_queue --- .../src/weights/cumulus_pallet_xcmp_queue.rs | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs index 16a431d8b18..5451b5e783b 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/cumulus_pallet_xcmp_queue.rs @@ -17,24 +17,25 @@ //! Autogenerated weights for `cumulus_pallet_xcmp_queue` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-08-09, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 1024 +//! DATE: 2022-11-16, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// /home/benchbot/cargo_target_dir/production/polkadot-parachain // benchmark // pallet -// --chain=statemine-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=cumulus_pallet_xcmp_queue -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=bridge-hub-kusama-dev // --header=./file_header.txt -// --output=./parachains/runtimes/assets/statemine/src/weights +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -48,13 +49,15 @@ pub struct WeightInfo(PhantomData); impl cumulus_pallet_xcmp_queue::WeightInfo for WeightInfo { // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_u32() -> Weight { - Weight::from_ref_time(5_634_000 as u64) + // Minimum execution time: 7_524 nanoseconds. + Weight::from_ref_time(7_779_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: XcmpQueue QueueConfig (r:1 w:1) fn set_config_with_weight() -> Weight { - Weight::from_ref_time(5_559_000 as u64) + // Minimum execution time: 7_468 nanoseconds. + Weight::from_ref_time(7_861_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } From e52641c1089074acbc8f20239959c536e6afca08 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Wed, 16 Nov 2022 22:33:35 +0000 Subject: [PATCH 27/39] ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_collator_selection --- .../src/weights/pallet_collator_selection.rs | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs index acfa3d23568..652b3e3fbc7 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_collator_selection.rs @@ -51,23 +51,23 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection Invulnerables (r:0 w:1) /// The range of component `b` is `[1, 100]`. fn set_invulnerables(b: u32, ) -> Weight { - // Minimum execution time: 23_238 nanoseconds. - Weight::from_ref_time(24_641_033 as u64) - // Standard Error: 2_887 - .saturating_add(Weight::from_ref_time(2_458_746 as u64).saturating_mul(b as u64)) + // Minimum execution time: 23_476 nanoseconds. + Weight::from_ref_time(25_244_018 as u64) + // Standard Error: 3_006 + .saturating_add(Weight::from_ref_time(2_470_729 as u64).saturating_mul(b as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(b as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection DesiredCandidates (r:0 w:1) fn set_desired_candidates() -> Weight { - // Minimum execution time: 14_081 nanoseconds. - Weight::from_ref_time(14_559_000 as u64) + // Minimum execution time: 14_256 nanoseconds. + Weight::from_ref_time(14_699_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection CandidacyBond (r:0 w:1) fn set_candidacy_bond() -> Weight { - // Minimum execution time: 14_048 nanoseconds. - Weight::from_ref_time(14_542_000 as u64) + // Minimum execution time: 14_610 nanoseconds. + Weight::from_ref_time(14_849_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: CollatorSelection Candidates (r:1 w:1) @@ -78,10 +78,10 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// The range of component `c` is `[1, 999]`. fn register_as_candidate(c: u32, ) -> Weight { - // Minimum execution time: 49_022 nanoseconds. - Weight::from_ref_time(65_830_450 as u64) - // Standard Error: 1_134 - .saturating_add(Weight::from_ref_time(166_499 as u64).saturating_mul(c as u64)) + // Minimum execution time: 49_939 nanoseconds. + Weight::from_ref_time(65_000_471 as u64) + // Standard Error: 971 + .saturating_add(Weight::from_ref_time(166_827 as u64).saturating_mul(c as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -89,10 +89,10 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) /// The range of component `c` is `[6, 1000]`. fn leave_intent(c: u32, ) -> Weight { - // Minimum execution time: 39_176 nanoseconds. - Weight::from_ref_time(60_721_956 as u64) - // Standard Error: 1_415 - .saturating_add(Weight::from_ref_time(158_944 as u64).saturating_mul(c as u64)) + // Minimum execution time: 39_651 nanoseconds. + Weight::from_ref_time(64_330_763 as u64) + // Standard Error: 1_784 + .saturating_add(Weight::from_ref_time(154_007 as u64).saturating_mul(c as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -100,8 +100,8 @@ impl pallet_collator_selection::WeightInfo for WeightIn // Storage: System BlockWeight (r:1 w:1) // Storage: CollatorSelection LastAuthoredBlock (r:0 w:1) fn note_author() -> Weight { - // Minimum execution time: 36_710 nanoseconds. - Weight::from_ref_time(37_440_000 as u64) + // Minimum execution time: 36_425 nanoseconds. + Weight::from_ref_time(37_314_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(4 as u64)) } @@ -113,10 +113,10 @@ impl pallet_collator_selection::WeightInfo for WeightIn /// The range of component `r` is `[1, 1000]`. /// The range of component `c` is `[1, 1000]`. fn new_session(_r: u32, c: u32, ) -> Weight { - // Minimum execution time: 22_483 nanoseconds. - Weight::from_ref_time(22_818_000 as u64) - // Standard Error: 630_790 - .saturating_add(Weight::from_ref_time(22_103_331 as u64).saturating_mul(c as u64)) + // Minimum execution time: 22_780 nanoseconds. + Weight::from_ref_time(23_070_000 as u64) + // Standard Error: 629_907 + .saturating_add(Weight::from_ref_time(22_042_278 as u64).saturating_mul(c as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(c as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) From b7b45a9ff498a5459620a3e70a70f96a2fc634c1 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 28 Nov 2022 11:25:03 +0100 Subject: [PATCH 28/39] Fixes --- parachain-template/runtime/src/lib.rs | 2 +- .../runtimes/assets/statemine/src/lib.rs | 2 +- .../runtimes/assets/statemint/src/lib.rs | 2 +- .../runtimes/assets/westmint/src/lib.rs | 2 +- .../bridge-hubs/bridge-hub-kusama/src/lib.rs | 42 +++---------------- .../bridge-hub-kusama/src/xcm_config.rs | 4 ++ .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 40 ++---------------- .../collectives-polkadot/src/lib.rs | 2 +- .../contracts/contracts-rococo/src/lib.rs | 2 +- parachains/runtimes/testing/penpal/src/lib.rs | 2 +- 10 files changed, 21 insertions(+), 79 deletions(-) diff --git a/parachain-template/runtime/src/lib.rs b/parachain-template/runtime/src/lib.rs index 35b9ba009e2..67a8295a0aa 100644 --- a/parachain-template/runtime/src/lib.rs +++ b/parachain-template/runtime/src/lib.rs @@ -407,7 +407,7 @@ impl pallet_session::Config for Runtime { type ShouldEndSession = pallet_session::PeriodicSessions; type NextSessionRotation = pallet_session::PeriodicSessions; type SessionManager = CollatorSelection; - // Essentially just Aura, but lets be pedantic. + // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = (); diff --git a/parachains/runtimes/assets/statemine/src/lib.rs b/parachains/runtimes/assets/statemine/src/lib.rs index e91a2ea68ad..14532ab54e9 100644 --- a/parachains/runtimes/assets/statemine/src/lib.rs +++ b/parachains/runtimes/assets/statemine/src/lib.rs @@ -480,7 +480,7 @@ impl pallet_session::Config for Runtime { type ShouldEndSession = pallet_session::PeriodicSessions; type NextSessionRotation = pallet_session::PeriodicSessions; type SessionManager = CollatorSelection; - // Essentially just Aura, but lets be pedantic. + // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = weights::pallet_session::WeightInfo; diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index b410474d1c0..5785f65c0d7 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -496,7 +496,7 @@ impl pallet_session::Config for Runtime { type ShouldEndSession = pallet_session::PeriodicSessions; type NextSessionRotation = pallet_session::PeriodicSessions; type SessionManager = CollatorSelection; - // Essentially just Aura, but lets be pedantic. + // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = weights::pallet_session::WeightInfo; diff --git a/parachains/runtimes/assets/westmint/src/lib.rs b/parachains/runtimes/assets/westmint/src/lib.rs index bada9f794f5..f75e9ab9879 100644 --- a/parachains/runtimes/assets/westmint/src/lib.rs +++ b/parachains/runtimes/assets/westmint/src/lib.rs @@ -458,7 +458,7 @@ impl pallet_session::Config for Runtime { type ShouldEndSession = pallet_session::PeriodicSessions; type NextSessionRotation = pallet_session::PeriodicSessions; type SessionManager = CollatorSelection; - // Essentially just Aura, but lets be pedantic. + // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = weights::pallet_session::WeightInfo; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index ac2b33efe44..e1f8c8c4530 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -70,30 +70,15 @@ use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; // XCM Imports use crate::xcm_config::KsmRelayLocation; use parachains_common::{ - AccountId, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, - NORMAL_DISPATCH_RATIO, SLOT_DURATION, + AccountId, Balance, BlockNumber, Header, Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, + MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm::latest::prelude::BodyId; use xcm_executor::XcmExecutor; -/// Balance of an account. -pub type Balance = u128; - -/// Index of a transaction in the chain. -pub type Index = u32; - -/// A hash of some data used by the chain. -pub type Hash = sp_core::H256; - -/// An index to a block. -pub type BlockNumber = u32; - /// The address format for describing accounts. pub type Address = 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; @@ -131,23 +116,6 @@ pub type Executive = frame_executive::Executive< AllPalletsWithSystem, >; -/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know -/// the specifics of the runtime. They can then be made to be agnostic over specific formats -/// of data like extrinsics, allowing for them to continue syncing the network through upgrades -/// to even the core data structures. -pub mod opaque { - use super::*; - use sp_runtime::{generic, traits::BlakeTwo256}; - - pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; - /// Opaque block header type. - pub type Header = generic::Header; - /// Opaque block type. - pub type Block = generic::Block; - /// Opaque block identifier type. - pub type BlockId = generic::BlockId; -} - impl_opaque_keys! { pub struct SessionKeys { pub aura: Aura, @@ -256,7 +224,7 @@ impl frame_system::Config for Runtime { impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; - type OnTimestampSet = (); + type OnTimestampSet = Aura; type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = weights::pallet_timestamp::WeightInfo; } @@ -321,6 +289,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} +// TODO: map gov2 origins here - after merge https://github.com/paritytech/cumulus/pull/1895 /// Privileged origin that represents Root or the majority of the Relay Chain Council. pub type RootOrExecutiveSimpleMajority = EitherOfDiverse< EnsureRoot, @@ -355,7 +324,7 @@ impl pallet_session::Config for Runtime { type ShouldEndSession = pallet_session::PeriodicSessions, ConstU32>; type NextSessionRotation = pallet_session::PeriodicSessions, ConstU32>; type SessionManager = CollatorSelection; - // Essentially just Aura, but lets be pedantic. + // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = weights::pallet_session::WeightInfo; @@ -373,6 +342,7 @@ parameter_types! { pub const ExecutiveBody: BodyId = BodyId::Executive; } +// TODO: map gov2 origins here - after merge https://github.com/paritytech/cumulus/pull/1895 /// We allow root and the Relay Chain council to execute privileged collator selection operations. pub type CollatorSelectionUpdateOrigin = RootOrExecutiveSimpleMajority; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index f05b52085a4..f8e142683fc 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -77,12 +77,14 @@ pub type XcmOriginToTransactDispatchOrigin = ( ); parameter_types! { + // TODO: change to meassured weights - https://github.com/paritytech/parity-bridges-common/issues/391 // One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate. pub UnitWeightCost: u64 = 1_000_000_000; pub const MaxInstructions: u32 = 100; } match_types! { + // TODO: map gov2 origins here - after merge https://github.com/paritytech/cumulus/pull/1895 pub type ParentOrParentsExecutivePlurality: impl Contains = { MultiLocation { parents: 1, interior: Here } | MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Executive, .. }) } @@ -122,6 +124,7 @@ impl xcm_executor::Config for XcmConfig { type IsTeleporter = ConcreteNativeAssetFrom; type LocationInverter = LocationInverter; type Barrier = Barrier; + // TODO: change to meassured weights - https://github.com/paritytech/parity-bridges-common/issues/391 type Weigher = FixedWeightBounds; type Trader = UsingComponents>; @@ -156,6 +159,7 @@ impl pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location. + // TODO: change to meassured weights - https://github.com/paritytech/parity-bridges-common/issues/391 type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; type RuntimeOrigin = RuntimeOrigin; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 7d51a8aed3d..ffc32d45bbc 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -71,30 +71,15 @@ use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; // XCM Imports use parachains_common::{ - AccountId, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, - NORMAL_DISPATCH_RATIO, SLOT_DURATION, + AccountId, Balance, BlockNumber, Header, Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, + MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm::latest::prelude::BodyId; use xcm_executor::XcmExecutor; -/// Balance of an account. -pub type Balance = u128; - -/// Index of a transaction in the chain. -pub type Index = u32; - -/// A hash of some data used by the chain. -pub type Hash = sp_core::H256; - -/// An index to a block. -pub type BlockNumber = u32; - /// The address format for describing accounts. pub type Address = 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; @@ -159,23 +144,6 @@ impl WeightToFeePolynomial for WeightToFee { } } -/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know -/// the specifics of the runtime. They can then be made to be agnostic over specific formats -/// of data like extrinsics, allowing for them to continue syncing the network through upgrades -/// to even the core data structures. -pub mod opaque { - use super::*; - use sp_runtime::{generic, traits::BlakeTwo256}; - - pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; - /// Opaque block header type. - pub type Header = generic::Header; - /// Opaque block type. - pub type Block = generic::Block; - /// Opaque block identifier type. - pub type BlockId = generic::BlockId; -} - impl_opaque_keys! { pub struct SessionKeys { pub aura: Aura, @@ -293,7 +261,7 @@ impl frame_system::Config for Runtime { impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; - type OnTimestampSet = (); + type OnTimestampSet = Aura; type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = weights::pallet_timestamp::WeightInfo; } @@ -386,7 +354,7 @@ impl pallet_session::Config for Runtime { type ShouldEndSession = pallet_session::PeriodicSessions, ConstU32>; type NextSessionRotation = pallet_session::PeriodicSessions, ConstU32>; type SessionManager = CollatorSelection; - // Essentially just Aura, but lets be pedantic. + // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = weights::pallet_session::WeightInfo; diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 30c85ac3f12..4fdef7a45f8 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -390,7 +390,7 @@ impl pallet_session::Config for Runtime { type ShouldEndSession = pallet_session::PeriodicSessions, ConstU32>; type NextSessionRotation = pallet_session::PeriodicSessions, ConstU32>; type SessionManager = CollatorSelection; - // Essentially just Aura, but lets be pedantic. + // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = weights::pallet_session::WeightInfo; diff --git a/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/parachains/runtimes/contracts/contracts-rococo/src/lib.rs index 79dada722dd..2b48912232d 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/lib.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/lib.rs @@ -282,7 +282,7 @@ impl pallet_session::Config for Runtime { type ShouldEndSession = pallet_session::PeriodicSessions; type NextSessionRotation = pallet_session::PeriodicSessions; type SessionManager = CollatorSelection; - // Essentially just Aura, but lets be pedantic. + // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = pallet_session::weights::SubstrateWeight; diff --git a/parachains/runtimes/testing/penpal/src/lib.rs b/parachains/runtimes/testing/penpal/src/lib.rs index 0be8baa9c18..fe1b17fcd53 100644 --- a/parachains/runtimes/testing/penpal/src/lib.rs +++ b/parachains/runtimes/testing/penpal/src/lib.rs @@ -452,7 +452,7 @@ impl pallet_session::Config for Runtime { type ShouldEndSession = pallet_session::PeriodicSessions; type NextSessionRotation = pallet_session::PeriodicSessions; type SessionManager = CollatorSelection; - // Essentially just Aura, but lets be pedantic. + // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type WeightInfo = (); From eb54ade2229e265f20d469ed9986507e78b8cea0 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 28 Nov 2022 11:36:56 +0100 Subject: [PATCH 29/39] Fixes --- parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs | 4 ++-- parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index e1f8c8c4530..aec59d240d8 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -70,8 +70,8 @@ use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; // XCM Imports use crate::xcm_config::KsmRelayLocation; use parachains_common::{ - AccountId, Balance, BlockNumber, Header, Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, - MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, + opaque, AccountId, Balance, BlockNumber, Hash, Header, Index, Signature, + AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm::latest::prelude::BodyId; use xcm_executor::XcmExecutor; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index ffc32d45bbc..f38ff165d7e 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -71,8 +71,8 @@ use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; // XCM Imports use parachains_common::{ - AccountId, Balance, BlockNumber, Header, Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, - MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, + opaque, AccountId, Balance, BlockNumber, Hash, Header, Index, Signature, + AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm::latest::prelude::BodyId; use xcm_executor::XcmExecutor; From d1e2e6db935a414585f70f9871e5f600c3dfaf8b Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 28 Nov 2022 11:46:29 +0100 Subject: [PATCH 30/39] rustfmt --- .../runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index f8e142683fc..5930db5e9a6 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -159,6 +159,7 @@ impl pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location. + // TODO: change to meassured weights - https://github.com/paritytech/parity-bridges-common/issues/391 type Weigher = FixedWeightBounds; type LocationInverter = LocationInverter; From 95093abb963d57addb125342c19f359e6f6987fd Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 28 Nov 2022 11:59:58 +0100 Subject: [PATCH 31/39] Fixes --- polkadot-parachain/src/chain_spec/bridge_hubs.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/polkadot-parachain/src/chain_spec/bridge_hubs.rs index 1431eb0a0e7..f04f38fb96e 100644 --- a/polkadot-parachain/src/chain_spec/bridge_hubs.rs +++ b/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -15,6 +15,7 @@ // along with Cumulus. If not, see . use cumulus_primitives_core::ParaId; +use parachains_common::Balance as BridgeHubBalance; use sc_chain_spec::ChainSpec; use sc_cli::RuntimeVersion; use std::{path::PathBuf, str::FromStr}; @@ -158,7 +159,7 @@ fn ensure_id(id: &str) -> Result<&str, String> { /// Sub-module for Rococo setup pub mod rococo { - use super::ParaId; + use super::{BridgeHubBalance, ParaId}; use crate::chain_spec::{ get_account_id_from_seed, get_collator_keys_from_seed, Extensions, SAFE_XCM_VERSION, }; @@ -169,7 +170,7 @@ pub mod rococo { pub(crate) const BRIDGE_HUB_ROCOCO: &str = "bridge-hub-rococo"; pub(crate) const BRIDGE_HUB_ROCOCO_LOCAL: &str = "bridge-hub-rococo-local"; pub(crate) const BRIDGE_HUB_ROCOCO_DEVELOPMENT: &str = "bridge-hub-rococo-dev"; - const BRIDGE_HUB_ROCOCO_ED: bridge_hub_rococo_runtime::Balance = + const BRIDGE_HUB_ROCOCO_ED: BridgeHubBalance = bridge_hub_rococo_runtime::constants::currency::EXISTENTIAL_DEPOSIT; /// Specialized `ChainSpec` for the normal parachain runtime. @@ -374,7 +375,7 @@ pub mod wococo { /// Sub-module for Kusama setup (reuses stuff from Rococo) pub mod kusama { - use super::ParaId; + use super::{BridgeHubBalance, ParaId}; use crate::chain_spec::{ get_account_id_from_seed, get_collator_keys_from_seed, Extensions, SAFE_XCM_VERSION, }; @@ -385,7 +386,7 @@ pub mod kusama { pub(crate) const BRIDGE_HUB_KUSAMA: &str = "bridge-hub-kusama"; pub(crate) const BRIDGE_HUB_KUSAMA_LOCAL: &str = "bridge-hub-kusama-local"; pub(crate) const BRIDGE_HUB_KUSAMA_DEVELOPMENT: &str = "bridge-hub-kusama-dev"; - const BRIDGE_HUB_KUSAMA_ED: bridge_hub_kusama_runtime::Balance = + const BRIDGE_HUB_KUSAMA_ED: BridgeHubBalance = bridge_hub_kusama_runtime::constants::currency::EXISTENTIAL_DEPOSIT; /// Specialized `ChainSpec` for the normal parachain runtime. From 8a5982987b94820e077f88f3e433d04e92134950 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 28 Nov 2022 15:47:48 +0100 Subject: [PATCH 32/39] Added pallet_utility/pallet_multisig --- Cargo.lock | 4 + .../bridge-hubs/bridge-hub-kusama/Cargo.toml | 4 + .../bridge-hub-kusama/src/constants.rs | 5 + .../bridge-hubs/bridge-hub-kusama/src/lib.rs | 30 ++++ .../bridge-hub-kusama/src/weights/mod.rs | 2 + .../src/weights/pallet_multisig.rs | 128 ++++++++++++++++++ .../src/weights/pallet_utility.rs | 78 +++++++++++ .../bridge-hubs/bridge-hub-rococo/Cargo.toml | 4 + .../bridge-hub-rococo/src/constants.rs | 5 + .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 31 +++++ .../bridge-hub-rococo/src/weights/mod.rs | 2 + .../src/weights/pallet_multisig.rs | 128 ++++++++++++++++++ .../src/weights/pallet_utility.rs | 78 +++++++++++ 13 files changed, 499 insertions(+) create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_multisig.rs create mode 100644 parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_utility.rs diff --git a/Cargo.lock b/Cargo.lock index acfe92df0b2..7827a8efa34 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -721,11 +721,13 @@ dependencies = [ "pallet-authorship", "pallet-balances", "pallet-collator-selection", + "pallet-multisig", "pallet-session", "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", "pallet-xcm", "pallet-xcm-benchmarks", "parachain-info", @@ -781,11 +783,13 @@ dependencies = [ "pallet-authorship", "pallet-balances", "pallet-collator-selection", + "pallet-multisig", "pallet-session", "pallet-sudo", "pallet-timestamp", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", "pallet-xcm", "pallet-xcm-benchmarks", "parachain-info", diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml index 6d8e1f669d1..cffc6760c48 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -27,11 +27,13 @@ frame-try-runtime = { git = "https://github.com/paritytech/substrate", default-f pallet-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -96,11 +98,13 @@ std = [ "pallet-authorship/std", "pallet-balances/std", "pallet-collator-selection/std", + "pallet-multisig/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/std", "parachain-info/std", "parachains-common/std", diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/constants.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/constants.rs index 158c003903e..f9ad2d9bd98 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/constants.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/constants.rs @@ -22,6 +22,11 @@ pub mod currency { pub const CENTS: Balance = constants::currency::CENTS; pub const MILLICENTS: Balance = constants::currency::MILLICENTS; + + pub const fn deposit(items: u32, bytes: u32) -> Balance { + // map to 1/100 of what the kusama relay chain charges (v9020) + constants::currency::deposit(items, bytes) / 100 + } } /// Fee-related. diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index aec59d240d8..71f32026ba3 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -362,6 +362,30 @@ impl pallet_collator_selection::Config for Runtime { 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; +} + +impl pallet_utility::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type PalletsOrigin = OriginCaller; + type WeightInfo = weights::pallet_utility::WeightInfo; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime where @@ -393,6 +417,10 @@ construct_runtime!( PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 33, + + // Handy utilities. + Utility: pallet_utility::{Pallet, Call, Event} = 40, + Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 41, } ); @@ -405,7 +433,9 @@ mod benches { define_benchmarks!( [frame_system, SystemBench::] [pallet_balances, Balances] + [pallet_multisig, Multisig] [pallet_session, SessionBench::] + [pallet_utility, Utility] [pallet_timestamp, Timestamp] [pallet_collator_selection, CollatorSelection] [cumulus_pallet_xcmp_queue, XcmpQueue] diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs index a1b84aed399..56c03468aa7 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/mod.rs @@ -23,8 +23,10 @@ pub mod extrinsic_weights; pub mod frame_system; pub mod pallet_balances; pub mod pallet_collator_selection; +pub mod pallet_multisig; pub mod pallet_session; pub mod pallet_timestamp; +pub mod pallet_utility; pub mod paritydb_weights; pub mod rocksdb_weights; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs new file mode 100644 index 00000000000..e24b7defc85 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs @@ -0,0 +1,128 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_multisig` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-11-10, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=collectives-polkadot-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_multisig +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_multisig.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::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 { + // Minimum execution time: 21_375 nanoseconds. + Weight::from_ref_time(22_118_304 as u64) + // Standard Error: 3 + .saturating_add(Weight::from_ref_time(584 as u64).saturating_mul(z as u64)) + } + // Storage: Multisig Multisigs (r:1 w:1) + // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) + /// 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 { + // Minimum execution time: 53_482 nanoseconds. + Weight::from_ref_time(41_399_699 as u64) + // Standard Error: 959 + .saturating_add(Weight::from_ref_time(133_568 as u64).saturating_mul(s as u64)) + // Standard Error: 9 + .saturating_add(Weight::from_ref_time(1_527 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Multisig Multisigs (r:1 w:1) + /// 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 { + // Minimum execution time: 40_666 nanoseconds. + Weight::from_ref_time(30_384_195 as u64) + // Standard Error: 1_027 + .saturating_add(Weight::from_ref_time(127_961 as u64).saturating_mul(s as u64)) + // Standard Error: 10 + .saturating_add(Weight::from_ref_time(1_572 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Multisig Multisigs (r:1 w:1) + // Storage: System Account (r:1 w:1) + /// 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 { + // Minimum execution time: 56_337 nanoseconds. + Weight::from_ref_time(44_163_779 as u64) + // Standard Error: 1_031 + .saturating_add(Weight::from_ref_time(150_104 as u64).saturating_mul(s as u64)) + // Standard Error: 10 + .saturating_add(Weight::from_ref_time(1_568 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: Multisig Multisigs (r:1 w:1) + // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) + /// The range of component `s` is `[2, 100]`. + fn approve_as_multi_create(s: u32, ) -> Weight { + // Minimum execution time: 36_552 nanoseconds. + Weight::from_ref_time(39_678_753 as u64) + // Standard Error: 972 + .saturating_add(Weight::from_ref_time(137_305 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Multisig Multisigs (r:1 w:1) + /// The range of component `s` is `[2, 100]`. + fn approve_as_multi_approve(s: u32, ) -> Weight { + // Minimum execution time: 27_419 nanoseconds. + Weight::from_ref_time(29_059_332 as u64) + // Standard Error: 753 + .saturating_add(Weight::from_ref_time(131_180 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Multisig Multisigs (r:1 w:1) + /// The range of component `s` is `[2, 100]`. + fn cancel_as_multi(s: u32, ) -> Weight { + // Minimum execution time: 37_335 nanoseconds. + Weight::from_ref_time(39_940_097 as u64) + // Standard Error: 1_233 + .saturating_add(Weight::from_ref_time(139_766 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs new file mode 100644 index 00000000000..f2eb033dd86 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs @@ -0,0 +1,78 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_utility` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-11-10, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=collectives-polkadot-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_utility +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_utility.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::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 { + // Minimum execution time: 13_238 nanoseconds. + Weight::from_ref_time(15_145_125 as u64) + // Standard Error: 2_535 + .saturating_add(Weight::from_ref_time(3_962_627 as u64).saturating_mul(c as u64)) + } + fn as_derivative() -> Weight { + // Minimum execution time: 6_888 nanoseconds. + Weight::from_ref_time(7_176_000 as u64) + } + /// The range of component `c` is `[0, 1000]`. + fn batch_all(c: u32, ) -> Weight { + // Minimum execution time: 13_696 nanoseconds. + Weight::from_ref_time(18_030_261 as u64) + // Standard Error: 2_621 + .saturating_add(Weight::from_ref_time(4_096_976 as u64).saturating_mul(c as u64)) + } + fn dispatch_as() -> Weight { + // Minimum execution time: 15_188 nanoseconds. + Weight::from_ref_time(15_682_000 as u64) + } + /// The range of component `c` is `[0, 1000]`. + fn force_batch(c: u32, ) -> Weight { + // Minimum execution time: 13_264 nanoseconds. + Weight::from_ref_time(23_406_948 as u64) + // Standard Error: 2_736 + .saturating_add(Weight::from_ref_time(3_949_653 as u64).saturating_mul(c as u64)) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index d1545396f28..76e84b6b28e 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -28,10 +28,12 @@ pallet-aura = { git = "https://github.com/paritytech/substrate", default-feature pallet-authorship = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-multisig = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-block-builder = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } @@ -95,11 +97,13 @@ std = [ "pallet-authorship/std", "pallet-balances/std", "pallet-collator-selection/std", + "pallet-multisig/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/std", "parachain-info/std", "parachains-common/std", diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/constants.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/constants.rs index ab716741d37..743e576396b 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/constants.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/constants.rs @@ -21,6 +21,11 @@ pub mod currency { pub const EXISTENTIAL_DEPOSIT: Balance = constants::currency::EXISTENTIAL_DEPOSIT / 10; pub const CENTS: Balance = constants::currency::CENTS; + + pub const fn deposit(items: u32, bytes: u32) -> Balance { + // map to 1/100 of what the rococo relay chain charges + constants::currency::deposit(items, bytes) / 100 + } } pub mod fee { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index f38ff165d7e..cdd07a48ec4 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -42,6 +42,7 @@ use sp_std::prelude::*; use sp_version::NativeVersion; use sp_version::RuntimeVersion; +use constants::currency::*; use frame_support::{ construct_runtime, dispatch::DispatchClass, @@ -390,6 +391,30 @@ impl pallet_collator_selection::Config for Runtime { 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; +} + +impl pallet_utility::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type PalletsOrigin = OriginCaller; + type WeightInfo = weights::pallet_utility::WeightInfo; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime where @@ -421,6 +446,10 @@ construct_runtime!( PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 33, + + // Handy utilities. + Utility: pallet_utility::{Pallet, Call, Event} = 40, + Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 41, } ); @@ -433,7 +462,9 @@ mod benches { define_benchmarks!( [frame_system, SystemBench::] [pallet_balances, Balances] + [pallet_multisig, Multisig] [pallet_session, SessionBench::] + [pallet_utility, Utility] [pallet_timestamp, Timestamp] [pallet_collator_selection, CollatorSelection] [cumulus_pallet_xcmp_queue, XcmpQueue] diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs index a1b84aed399..56c03468aa7 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs @@ -23,8 +23,10 @@ pub mod extrinsic_weights; pub mod frame_system; pub mod pallet_balances; pub mod pallet_collator_selection; +pub mod pallet_multisig; pub mod pallet_session; pub mod pallet_timestamp; +pub mod pallet_utility; pub mod paritydb_weights; pub mod rocksdb_weights; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_multisig.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_multisig.rs new file mode 100644 index 00000000000..e24b7defc85 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_multisig.rs @@ -0,0 +1,128 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_multisig` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-11-10, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=collectives-polkadot-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_multisig +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_multisig.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::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 { + // Minimum execution time: 21_375 nanoseconds. + Weight::from_ref_time(22_118_304 as u64) + // Standard Error: 3 + .saturating_add(Weight::from_ref_time(584 as u64).saturating_mul(z as u64)) + } + // Storage: Multisig Multisigs (r:1 w:1) + // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) + /// 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 { + // Minimum execution time: 53_482 nanoseconds. + Weight::from_ref_time(41_399_699 as u64) + // Standard Error: 959 + .saturating_add(Weight::from_ref_time(133_568 as u64).saturating_mul(s as u64)) + // Standard Error: 9 + .saturating_add(Weight::from_ref_time(1_527 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Multisig Multisigs (r:1 w:1) + /// 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 { + // Minimum execution time: 40_666 nanoseconds. + Weight::from_ref_time(30_384_195 as u64) + // Standard Error: 1_027 + .saturating_add(Weight::from_ref_time(127_961 as u64).saturating_mul(s as u64)) + // Standard Error: 10 + .saturating_add(Weight::from_ref_time(1_572 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Multisig Multisigs (r:1 w:1) + // Storage: System Account (r:1 w:1) + /// 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 { + // Minimum execution time: 56_337 nanoseconds. + Weight::from_ref_time(44_163_779 as u64) + // Standard Error: 1_031 + .saturating_add(Weight::from_ref_time(150_104 as u64).saturating_mul(s as u64)) + // Standard Error: 10 + .saturating_add(Weight::from_ref_time(1_568 as u64).saturating_mul(z as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: Multisig Multisigs (r:1 w:1) + // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) + /// The range of component `s` is `[2, 100]`. + fn approve_as_multi_create(s: u32, ) -> Weight { + // Minimum execution time: 36_552 nanoseconds. + Weight::from_ref_time(39_678_753 as u64) + // Standard Error: 972 + .saturating_add(Weight::from_ref_time(137_305 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Multisig Multisigs (r:1 w:1) + /// The range of component `s` is `[2, 100]`. + fn approve_as_multi_approve(s: u32, ) -> Weight { + // Minimum execution time: 27_419 nanoseconds. + Weight::from_ref_time(29_059_332 as u64) + // Standard Error: 753 + .saturating_add(Weight::from_ref_time(131_180 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Multisig Multisigs (r:1 w:1) + /// The range of component `s` is `[2, 100]`. + fn cancel_as_multi(s: u32, ) -> Weight { + // Minimum execution time: 37_335 nanoseconds. + Weight::from_ref_time(39_940_097 as u64) + // Standard Error: 1_233 + .saturating_add(Weight::from_ref_time(139_766 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_utility.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_utility.rs new file mode 100644 index 00000000000..f2eb033dd86 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_utility.rs @@ -0,0 +1,78 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_utility` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-11-10, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 + +// Executed Command: +// ./artifacts/polkadot-parachain +// benchmark +// pallet +// --chain=collectives-polkadot-dev +// --execution=wasm +// --wasm-execution=compiled +// --pallet=pallet_utility +// --extrinsic=* +// --steps=50 +// --repeat=20 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_utility.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::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 { + // Minimum execution time: 13_238 nanoseconds. + Weight::from_ref_time(15_145_125 as u64) + // Standard Error: 2_535 + .saturating_add(Weight::from_ref_time(3_962_627 as u64).saturating_mul(c as u64)) + } + fn as_derivative() -> Weight { + // Minimum execution time: 6_888 nanoseconds. + Weight::from_ref_time(7_176_000 as u64) + } + /// The range of component `c` is `[0, 1000]`. + fn batch_all(c: u32, ) -> Weight { + // Minimum execution time: 13_696 nanoseconds. + Weight::from_ref_time(18_030_261 as u64) + // Standard Error: 2_621 + .saturating_add(Weight::from_ref_time(4_096_976 as u64).saturating_mul(c as u64)) + } + fn dispatch_as() -> Weight { + // Minimum execution time: 15_188 nanoseconds. + Weight::from_ref_time(15_682_000 as u64) + } + /// The range of component `c` is `[0, 1000]`. + fn force_batch(c: u32, ) -> Weight { + // Minimum execution time: 13_264 nanoseconds. + Weight::from_ref_time(23_406_948 as u64) + // Standard Error: 2_736 + .saturating_add(Weight::from_ref_time(3_949_653 as u64).saturating_mul(c as u64)) + } +} From 495a06da9a57f88fb0bf622dee29f53aa55ecf11 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 28 Nov 2022 16:12:18 +0100 Subject: [PATCH 33/39] Blind try for regex pr-custom-review.yml (added bridge-hub-kusama + collectives-polkadot) --- .github/pr-custom-review.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/pr-custom-review.yml b/.github/pr-custom-review.yml index 99155388877..f8c887c5f4a 100644 --- a/.github/pr-custom-review.yml +++ b/.github/pr-custom-review.yml @@ -6,7 +6,7 @@ action-review-team: ci rules: - name: Runtime files check_type: changed_files - condition: ^parachains/runtimes/assets/(statemine|statemint)/src/[^/]+\.rs$ + condition: ^parachains/runtimes/assets/(statemine|statemint)/src/[^/]+\.rs$|^parachains/runtimes/bridge-hubs/(bridge-hub-kusama|bridge-hub-polkadot)/src/[^/]+\.rs$|^parachains/runtimes/collectives/collectives-polkadot/src/[^/]+\.rs$|^parachains/common/src/[^/]+\.rs$ all_distinct: - min_approvals: 1 teams: @@ -20,7 +20,7 @@ rules: condition: include: .* # excluding files from 'Runtime files' and 'CI files' rules - exclude: ^parachains/runtimes/assets/(statemine|statemint)/src/[^/]+\.rs$|^\.gitlab-ci\.yml|^scripts/ci/.*|^\.github/.* + exclude: ^parachains/runtimes/assets/(statemine|statemint)/src/[^/]+\.rs$|^parachains/runtimes/bridge-hubs/(bridge-hub-kusama|bridge-hub-polkadot)/src/[^/]+\.rs$|^parachains/runtimes/collectives/collectives-polkadot/src/[^/]+\.rs$|^parachains/common/src/[^/]+\.rs$|^\.gitlab-ci\.yml|^scripts/ci/.*|^\.github/.* min_approvals: 2 teams: - core-devs From 670b3e356cd5c5978ee03047ece5df2df24ebee6 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 28 Nov 2022 16:17:16 +0100 Subject: [PATCH 34/39] Fixes --- parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml | 4 ++++ parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml index cffc6760c48..496dc1708ad 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -134,7 +134,9 @@ runtime-benchmarks = [ "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", + "pallet-multisig/std", "pallet-timestamp/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", @@ -157,9 +159,11 @@ try-runtime = [ "pallet-authorship/try-runtime", "pallet-balances/try-runtime", "pallet-collator-selection/try-runtime", + "pallet-multisig/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", ] diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index 76e84b6b28e..f8936ed1d13 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -134,7 +134,9 @@ runtime-benchmarks = [ "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", + "pallet-multisig/std", "pallet-timestamp/runtime-benchmarks", + "pallet-utility/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", @@ -157,9 +159,11 @@ try-runtime = [ "pallet-authorship/try-runtime", "pallet-balances/try-runtime", "pallet-collator-selection/try-runtime", + "pallet-multisig/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", ] From 64e53a3f6f0c0242f4a0dbd50167e6d10ad56929 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 28 Nov 2022 16:35:23 +0100 Subject: [PATCH 35/39] Fixes --- parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml | 2 +- parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml index 496dc1708ad..58ae69e1310 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -134,7 +134,7 @@ runtime-benchmarks = [ "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", - "pallet-multisig/std", + "pallet-multisig/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index f8936ed1d13..a970ac909cf 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -134,7 +134,7 @@ runtime-benchmarks = [ "frame-system-benchmarking/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-balances/runtime-benchmarks", - "pallet-multisig/std", + "pallet-multisig/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-utility/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", From 922b3cd8e0eae69da31c9f5ffc526f113387ef34 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Mon, 28 Nov 2022 16:05:11 +0000 Subject: [PATCH 36/39] ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_utility --- .../src/weights/pallet_utility.rs | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs index f2eb033dd86..5d01554103c 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_utility.rs @@ -17,24 +17,25 @@ //! Autogenerated weights for `pallet_utility` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-10, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 +//! DATE: 2022-11-28, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// /home/benchbot/cargo_target_dir/production/polkadot-parachain // benchmark // pallet -// --chain=collectives-polkadot-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_utility -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=bridge-hub-kusama-dev // --header=./file_header.txt -// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_utility.rs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -48,31 +49,31 @@ pub struct WeightInfo(PhantomData); impl pallet_utility::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. fn batch(c: u32, ) -> Weight { - // Minimum execution time: 13_238 nanoseconds. - Weight::from_ref_time(15_145_125 as u64) - // Standard Error: 2_535 - .saturating_add(Weight::from_ref_time(3_962_627 as u64).saturating_mul(c as u64)) + // Minimum execution time: 13_125 nanoseconds. + Weight::from_ref_time(16_447_372) + // Standard Error: 3_779 + .saturating_add(Weight::from_ref_time(3_932_973).saturating_mul(c.into())) } fn as_derivative() -> Weight { - // Minimum execution time: 6_888 nanoseconds. - Weight::from_ref_time(7_176_000 as u64) + // Minimum execution time: 6_608 nanoseconds. + Weight::from_ref_time(7_018_000) } /// The range of component `c` is `[0, 1000]`. fn batch_all(c: u32, ) -> Weight { - // Minimum execution time: 13_696 nanoseconds. - Weight::from_ref_time(18_030_261 as u64) - // Standard Error: 2_621 - .saturating_add(Weight::from_ref_time(4_096_976 as u64).saturating_mul(c as u64)) + // Minimum execution time: 13_626 nanoseconds. + Weight::from_ref_time(21_504_852) + // Standard Error: 2_865 + .saturating_add(Weight::from_ref_time(4_036_604).saturating_mul(c.into())) } fn dispatch_as() -> Weight { - // Minimum execution time: 15_188 nanoseconds. - Weight::from_ref_time(15_682_000 as u64) + // Minimum execution time: 15_428 nanoseconds. + Weight::from_ref_time(15_774_000) } /// The range of component `c` is `[0, 1000]`. fn force_batch(c: u32, ) -> Weight { - // Minimum execution time: 13_264 nanoseconds. - Weight::from_ref_time(23_406_948 as u64) - // Standard Error: 2_736 - .saturating_add(Weight::from_ref_time(3_949_653 as u64).saturating_mul(c as u64)) + // Minimum execution time: 13_252 nanoseconds. + Weight::from_ref_time(14_619_070) + // Standard Error: 2_171 + .saturating_add(Weight::from_ref_time(3_886_755).saturating_mul(c.into())) } } From a1bd1dcffbcac49c49ca000e93e3eddd6b99ac12 Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Mon, 28 Nov 2022 16:31:52 +0000 Subject: [PATCH 37/39] ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_multisig --- .../src/weights/pallet_multisig.rs | 113 +++++++++--------- 1 file changed, 57 insertions(+), 56 deletions(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs index e24b7defc85..9e41c0a8524 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/pallet_multisig.rs @@ -17,24 +17,25 @@ //! Autogenerated weights for `pallet_multisig` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-11-10, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("collectives-polkadot-dev"), DB CACHE: 1024 +//! DATE: 2022-11-28, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-kusama-dev"), DB CACHE: 1024 // Executed Command: -// ./artifacts/polkadot-parachain +// /home/benchbot/cargo_target_dir/production/polkadot-parachain // benchmark // pallet -// --chain=collectives-polkadot-dev +// --steps=50 +// --repeat=20 +// --extrinsic=* // --execution=wasm // --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/cumulus/.git/.artifacts/bench.json // --pallet=pallet_multisig -// --extrinsic=* -// --steps=50 -// --repeat=20 -// --json +// --chain=bridge-hub-kusama-dev // --header=./file_header.txt -// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/pallet_multisig.rs +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -48,81 +49,81 @@ 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 { - // Minimum execution time: 21_375 nanoseconds. - Weight::from_ref_time(22_118_304 as u64) - // Standard Error: 3 - .saturating_add(Weight::from_ref_time(584 as u64).saturating_mul(z as u64)) + // Minimum execution time: 21_383 nanoseconds. + Weight::from_ref_time(22_189_472) + // Standard Error: 6 + .saturating_add(Weight::from_ref_time(534).saturating_mul(z.into())) } // Storage: Multisig Multisigs (r:1 w:1) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) /// 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 { - // Minimum execution time: 53_482 nanoseconds. - Weight::from_ref_time(41_399_699 as u64) - // Standard Error: 959 - .saturating_add(Weight::from_ref_time(133_568 as u64).saturating_mul(s as u64)) - // Standard Error: 9 - .saturating_add(Weight::from_ref_time(1_527 as u64).saturating_mul(z as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + // Minimum execution time: 52_428 nanoseconds. + Weight::from_ref_time(39_213_076) + // Standard Error: 773 + .saturating_add(Weight::from_ref_time(144_541).saturating_mul(s.into())) + // Standard Error: 7 + .saturating_add(Weight::from_ref_time(1_553).saturating_mul(z.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Multisig Multisigs (r:1 w:1) /// 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 { - // Minimum execution time: 40_666 nanoseconds. - Weight::from_ref_time(30_384_195 as u64) - // Standard Error: 1_027 - .saturating_add(Weight::from_ref_time(127_961 as u64).saturating_mul(s as u64)) - // Standard Error: 10 - .saturating_add(Weight::from_ref_time(1_572 as u64).saturating_mul(z as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + // Minimum execution time: 41_359 nanoseconds. + Weight::from_ref_time(29_318_634) + // Standard Error: 723 + .saturating_add(Weight::from_ref_time(135_304).saturating_mul(s.into())) + // Standard Error: 7 + .saturating_add(Weight::from_ref_time(1_528).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) // Storage: System Account (r:1 w:1) /// 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 { - // Minimum execution time: 56_337 nanoseconds. - Weight::from_ref_time(44_163_779 as u64) - // Standard Error: 1_031 - .saturating_add(Weight::from_ref_time(150_104 as u64).saturating_mul(s as u64)) - // Standard Error: 10 - .saturating_add(Weight::from_ref_time(1_568 as u64).saturating_mul(z as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + // Minimum execution time: 55_465 nanoseconds. + Weight::from_ref_time(42_404_323) + // Standard Error: 719 + .saturating_add(Weight::from_ref_time(155_812).saturating_mul(s.into())) + // Standard Error: 7 + .saturating_add(Weight::from_ref_time(1_550).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) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_create(s: u32, ) -> Weight { - // Minimum execution time: 36_552 nanoseconds. - Weight::from_ref_time(39_678_753 as u64) - // Standard Error: 972 - .saturating_add(Weight::from_ref_time(137_305 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + // Minimum execution time: 36_194 nanoseconds. + Weight::from_ref_time(38_567_667) + // Standard Error: 1_067 + .saturating_add(Weight::from_ref_time(132_773).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) } // Storage: Multisig Multisigs (r:1 w:1) /// The range of component `s` is `[2, 100]`. fn approve_as_multi_approve(s: u32, ) -> Weight { - // Minimum execution time: 27_419 nanoseconds. - Weight::from_ref_time(29_059_332 as u64) - // Standard Error: 753 - .saturating_add(Weight::from_ref_time(131_180 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + // Minimum execution time: 25_984 nanoseconds. + Weight::from_ref_time(27_881_834) + // Standard Error: 910 + .saturating_add(Weight::from_ref_time(130_467).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) /// The range of component `s` is `[2, 100]`. fn cancel_as_multi(s: u32, ) -> Weight { - // Minimum execution time: 37_335 nanoseconds. - Weight::from_ref_time(39_940_097 as u64) - // Standard Error: 1_233 - .saturating_add(Weight::from_ref_time(139_766 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + // Minimum execution time: 36_468 nanoseconds. + Weight::from_ref_time(38_351_354) + // Standard Error: 1_069 + .saturating_add(Weight::from_ref_time(142_178).saturating_mul(s.into())) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) } } From fc86117c7b42cb5f2f4f7cfe71a58e9a7449cac2 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 24 Nov 2022 15:19:53 +0100 Subject: [PATCH 38/39] Trying to fix sed expression? --- .github/workflows/release-30_create-draft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-30_create-draft.yml b/.github/workflows/release-30_create-draft.yml index 6afc4b8d9da..1c69dd15999 100644 --- a/.github/workflows/release-30_create-draft.yml +++ b/.github/workflows/release-30_create-draft.yml @@ -267,7 +267,7 @@ jobs: id: fix-runtime-path run: | cd "${{ matrix.runtime }}-runtime/" - mv "$(sed -E 's/-(.*)/_\1/' <<< ${{ matrix.runtime }})_runtime.compact.compressed.wasm" "${{ matrix.runtime }}_runtime.compact.compressed.wasm" || true + mv "$(sed -E 's/- */_/g' <<< ${{ matrix.runtime }})_runtime.compact.compressed.wasm" "${{ matrix.runtime }}_runtime.compact.compressed.wasm" || true - name: Upload compressed ${{ matrix.runtime }} wasm uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 From 32a951a2e707ac5b9d40d83bf774ac97aa7bd9e9 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 1 Dec 2022 22:24:55 +0100 Subject: [PATCH 39/39] Added license headers + correct "DAG:" desc --- .../bridge-hub-kusama/src/xcm_config.rs | 16 ++++++++++++++++ .../bridge-hub-rococo/src/xcm_config.rs | 16 ++++++++++++++++ scripts/ci/gitlab/pipeline/build.yml | 3 ++- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs index 5930db5e9a6..317655663f0 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs @@ -1,3 +1,19 @@ +// Copyright 2022 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + use super::{ AccountId, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index 64a2d16f6c8..77b18b28cbb 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -1,3 +1,19 @@ +// Copyright 2022 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + use super::{ AccountId, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, WeightToFee, XcmpQueue, diff --git a/scripts/ci/gitlab/pipeline/build.yml b/scripts/ci/gitlab/pipeline/build.yml index ef304577be1..2b6a284ee11 100644 --- a/scripts/ci/gitlab/pipeline/build.yml +++ b/scripts/ci/gitlab/pipeline/build.yml @@ -69,7 +69,8 @@ build-test-parachain: cd ..; done -# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-bridge-hubs -> build-runtime-contracts +# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-bridge-hubs +# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-contracts # DAG: build-runtime-assets -> build-runtime-starters -> build-runtime-testing build-runtime-assets: <<: *build-runtime-template