From 5386d1821a021b3ede941c5c301802856997f53c Mon Sep 17 00:00:00 2001 From: Sebastian Kunert Date: Wed, 19 Jul 2023 13:46:58 +0200 Subject: [PATCH 01/17] Use trie-cache for `validate_block` (#2813) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Simple cache * Fix node insertion * Switch to hashbrown hashmap * Remove unused phantomdata * Return error when fetch_node fails * Remove cargo patches * Move trie cache to extra module * Add ReadOnceBackend * Add readonlybackend * Improve naming and get_or_insert * Stylistic improvements * Improve naming, add docs * Revert unwanted changes * Remove unused dependencies * Improve docs * Use RefCell * lockfile * Remove ReadOnceBackend * Apply suggestions from code review Co-authored-by: Bastian Köcher * Code review * Do not use value cache when calculating storage roots * Apply suggestions from code review Co-authored-by: Davide Galassi * Remove hash-db dep * Update pallets/parachain-system/src/validate_block/trie_cache.rs Co-authored-by: Anton --------- Co-authored-by: Bastian Köcher Co-authored-by: Davide Galassi Co-authored-by: Anton --- Cargo.lock | 1 + pallets/parachain-system/Cargo.toml | 2 + .../src/validate_block/implementation.rs | 17 ++- .../src/validate_block/mod.rs | 4 + .../src/validate_block/trie_cache.rs | 104 ++++++++++++++++++ 5 files changed, 124 insertions(+), 4 deletions(-) create mode 100644 pallets/parachain-system/src/validate_block/trie_cache.rs diff --git a/Cargo.lock b/Cargo.lock index 86cda7a6628..c320c9d7dc4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2907,6 +2907,7 @@ dependencies = [ "sp-tracing", "sp-trie", "sp-version", + "trie-db", "xcm", ] diff --git a/pallets/parachain-system/Cargo.toml b/pallets/parachain-system/Cargo.toml index f3d8a3bee44..61660d4de81 100644 --- a/pallets/parachain-system/Cargo.toml +++ b/pallets/parachain-system/Cargo.toml @@ -11,6 +11,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = environmental = { version = "1.1.4", default-features = false } impl-trait-for-tuples = "0.2.1" log = { version = "0.4.19", default-features = false } +trie-db = { version = "0.27.1", default-features = false } scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } # Substrate @@ -69,6 +70,7 @@ std = [ "sp-std/std", "sp-trie/std", "xcm/std", + "trie-db/std", ] runtime-benchmarks = [ diff --git a/pallets/parachain-system/src/validate_block/implementation.rs b/pallets/parachain-system/src/validate_block/implementation.rs index f953dfc77c5..71a6338dcd3 100644 --- a/pallets/parachain-system/src/validate_block/implementation.rs +++ b/pallets/parachain-system/src/validate_block/implementation.rs @@ -16,7 +16,7 @@ //! The actual implementation of the validate block functionality. -use super::MemoryOptimizedValidationParams; +use super::{trie_cache, MemoryOptimizedValidationParams}; use cumulus_primitives_core::{ relay_chain::Hash as RHash, ParachainBlockData, PersistedValidationData, }; @@ -34,7 +34,11 @@ use sp_runtime::traits::{Block as BlockT, Extrinsic, HashFor, Header as HeaderT} use sp_std::prelude::*; use sp_trie::MemoryDB; -type TrieBackend = sp_state_machine::TrieBackend>, HashFor>; +type TrieBackend = sp_state_machine::TrieBackend< + MemoryDB>, + HashFor, + trie_cache::CacheProvider>, +>; type Ext<'a, B> = sp_state_machine::Ext<'a, HashFor, TrieBackend>; @@ -114,10 +118,15 @@ where sp_std::mem::drop(storage_proof); + let cache_provider = trie_cache::CacheProvider::new(); // We use the storage root of the `parent_head` to ensure that it is the correct root. // This is already being done above while creating the in-memory db, but let's be paranoid!! - let backend = - sp_state_machine::TrieBackendBuilder::new(db, *parent_header.state_root()).build(); + let backend = sp_state_machine::TrieBackendBuilder::new_with_cache( + db, + *parent_header.state_root(), + cache_provider, + ) + .build(); let _guard = ( // Replace storage calls with our own implementations diff --git a/pallets/parachain-system/src/validate_block/mod.rs b/pallets/parachain-system/src/validate_block/mod.rs index e641c77f897..4e387bf8496 100644 --- a/pallets/parachain-system/src/validate_block/mod.rs +++ b/pallets/parachain-system/src/validate_block/mod.rs @@ -22,6 +22,10 @@ pub mod implementation; #[cfg(test)] mod tests; +#[cfg(not(feature = "std"))] +#[doc(hidden)] +mod trie_cache; + #[cfg(not(feature = "std"))] #[doc(hidden)] pub use bytes; diff --git a/pallets/parachain-system/src/validate_block/trie_cache.rs b/pallets/parachain-system/src/validate_block/trie_cache.rs new file mode 100644 index 00000000000..57876b87876 --- /dev/null +++ b/pallets/parachain-system/src/validate_block/trie_cache.rs @@ -0,0 +1,104 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use sp_state_machine::TrieCacheProvider; +use sp_std::{ + boxed::Box, + cell::{RefCell, RefMut}, + collections::btree_map::{BTreeMap, Entry}, +}; +use sp_trie::NodeCodec; +use trie_db::{node::NodeOwned, Hasher}; + +/// Special purpose trie cache implementation that is able to cache an unlimited number +/// of values. To be used in `validate_block` to serve values and nodes that +/// have already been loaded and decoded from the storage proof. +pub(crate) struct TrieCache<'a, H: Hasher> { + node_cache: RefMut<'a, BTreeMap>>, + value_cache: Option, trie_db::CachedValue>>>, +} + +impl<'a, H: Hasher> trie_db::TrieCache> for TrieCache<'a, H> { + fn lookup_value_for_key(&mut self, key: &[u8]) -> Option<&trie_db::CachedValue> { + self.value_cache.as_ref().and_then(|cache| cache.get(key)) + } + + fn cache_value_for_key(&mut self, key: &[u8], value: trie_db::CachedValue) { + self.value_cache.as_mut().and_then(|cache| cache.insert(key.into(), value)); + } + + fn get_or_insert_node( + &mut self, + hash: as trie_db::NodeCodec>::HashOut, + fetch_node: &mut dyn FnMut() -> trie_db::Result< + NodeOwned, + H::Out, + as trie_db::NodeCodec>::Error, + >, + ) -> trie_db::Result<&NodeOwned, H::Out, as trie_db::NodeCodec>::Error> { + match self.node_cache.entry(hash) { + Entry::Occupied(entry) => Ok(entry.into_mut()), + Entry::Vacant(entry) => Ok(entry.insert(fetch_node()?)), + } + } + + fn get_node( + &mut self, + hash: &H::Out, + ) -> Option<&NodeOwned< as trie_db::NodeCodec>::HashOut>> { + self.node_cache.get(hash) + } +} + +/// Provider of [`TrieCache`] instances. +pub(crate) struct CacheProvider { + node_cache: RefCell>>, + value_cache: RefCell, trie_db::CachedValue>>, +} + +impl CacheProvider { + /// Constructs a new instance of [`CacheProvider`] with an uninitialized state + /// and empty node and value caches. + pub fn new() -> Self { + CacheProvider { node_cache: Default::default(), value_cache: Default::default() } + } +} + +impl TrieCacheProvider for CacheProvider { + type Cache<'a> = TrieCache<'a, H> where H: 'a; + + fn as_trie_db_cache(&self, _storage_root: ::Out) -> Self::Cache<'_> { + TrieCache { + value_cache: Some(self.value_cache.borrow_mut()), + node_cache: self.node_cache.borrow_mut(), + } + } + + fn as_trie_db_mut_cache(&self) -> Self::Cache<'_> { + // This method is called when we calculate the storage root. + // Since we are using a simplified cache architecture, + // we do not have separate key spaces for different storage roots. + // The value cache is therefore disabled here. + TrieCache { value_cache: None, node_cache: self.node_cache.borrow_mut() } + } + + fn merge<'a>(&'a self, _other: Self::Cache<'a>, _new_root: ::Out) {} +} + +// This is safe here since we are single-threaded in WASM +unsafe impl Send for CacheProvider {} +unsafe impl Sync for CacheProvider {} From 9b97daf8c85ed3ede697700d53164df9d5d15443 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 16:34:09 +0200 Subject: [PATCH 02/17] Bump quote from 1.0.30 to 1.0.31 (#2895) Bumps [quote](https://github.com/dtolnay/quote) from 1.0.30 to 1.0.31. - [Release notes](https://github.com/dtolnay/quote/releases) - [Commits](https://github.com/dtolnay/quote/compare/1.0.30...1.0.31) --- updated-dependencies: - dependency-name: quote dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- pallets/parachain-system/proc-macro/Cargo.toml | 2 +- xcm/xcm-emulator/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c320c9d7dc4..0524110d1f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10902,9 +10902,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.64" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -11073,9 +11073,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5907a1b7c277254a8b15170f6e7c97cfa60ee7872a3217663bb81151e48184bb" +checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" dependencies = [ "proc-macro2", ] diff --git a/pallets/parachain-system/proc-macro/Cargo.toml b/pallets/parachain-system/proc-macro/Cargo.toml index 9162fac35f2..0d5bf09c633 100644 --- a/pallets/parachain-system/proc-macro/Cargo.toml +++ b/pallets/parachain-system/proc-macro/Cargo.toml @@ -11,7 +11,7 @@ proc-macro = true [dependencies] syn = "2.0.26" proc-macro2 = "1.0.64" -quote = "1.0.30" +quote = "1.0.31" proc-macro-crate = "1.3.1" [features] diff --git a/xcm/xcm-emulator/Cargo.toml b/xcm/xcm-emulator/Cargo.toml index db595ec6d1e..55ee9488776 100644 --- a/xcm/xcm-emulator/Cargo.toml +++ b/xcm/xcm-emulator/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] codec = { package = "parity-scale-codec", version = "3.0.0" } paste = "1.0.14" -quote = "1.0.30" +quote = "1.0.31" casey = "0.4.0" log = { version = "0.4.19", default-features = false } From cbb119dffe3950119a074e27e657a4eba06da109 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 17:53:54 +0200 Subject: [PATCH 03/17] Bump dyn-clone from 1.0.11 to 1.0.12 (#2897) Bumps [dyn-clone](https://github.com/dtolnay/dyn-clone) from 1.0.11 to 1.0.12. - [Release notes](https://github.com/dtolnay/dyn-clone/releases) - [Commits](https://github.com/dtolnay/dyn-clone/compare/1.0.11...1.0.12) --- updated-dependencies: - dependency-name: dyn-clone dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- client/consensus/common/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0524110d1f5..e21ac233f20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3781,9 +3781,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" +checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" [[package]] name = "ecdsa" diff --git a/client/consensus/common/Cargo.toml b/client/consensus/common/Cargo.toml index c6e48ca95bc..9457e4dc3ad 100644 --- a/client/consensus/common/Cargo.toml +++ b/client/consensus/common/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] async-trait = "0.1.71" codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] } -dyn-clone = "1.0.11" +dyn-clone = "1.0.12" futures = "0.3.28" log = "0.4.19" tracing = "0.1.37" From e318da57453c872f837106a9f9d826f7950d0a64 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Wed, 19 Jul 2023 19:29:12 +0300 Subject: [PATCH 04/17] Update bridges subtree (#2903) * Squashed 'bridges/' changes from 0417308a48..3c4ada921b 3c4ada921b Update dependecies (#2277) (#2281) 3e195c9e76 GRANDPA: optimize votes_ancestries when needed (#2262) (#2264) 7065bbabc6 Implement RuntimeDebug for GrandpaJustification (#2254) 8c9e59bcbc Define generate_grandpa_key_ownership_proof() (#2247) (#2248) 0b46956df7 Deduplicate Grandpa consensus log reading logic (#2245) (#2246) 96c9701710 Fix deps from Cumulus (#2244) git-subtree-dir: bridges git-subtree-split: 3c4ada921bbdbdba945c3aa85d76ce316f7baab3 * removed extra files * post-merge fixes * also post-merge fixes --- bridges/bin/runtime-common/src/integrity.rs | 2 +- bridges/bin/runtime-common/src/mock.rs | 15 +- .../src/parachains_benchmarking.rs | 2 +- .../src/refund_relayer_extension.rs | 9 +- bridges/modules/grandpa/src/call_ext.rs | 8 +- bridges/modules/grandpa/src/lib.rs | 52 +--- bridges/modules/grandpa/src/mock.rs | 7 +- .../modules/parachains/src/benchmarking.rs | 2 +- bridges/modules/parachains/src/lib.rs | 15 +- bridges/modules/parachains/src/mock.rs | 24 +- bridges/modules/relayers/src/mock.rs | 2 +- .../chain-bridge-hub-cumulus/src/lib.rs | 6 +- .../chain-bridge-hub-kusama/src/lib.rs | 4 +- .../chain-bridge-hub-polkadot/src/lib.rs | 4 +- .../chain-bridge-hub-rococo/src/lib.rs | 4 +- .../chain-bridge-hub-wococo/src/lib.rs | 4 +- bridges/primitives/chain-kusama/src/lib.rs | 3 +- bridges/primitives/chain-polkadot/src/lib.rs | 3 +- bridges/primitives/chain-rococo/src/lib.rs | 4 +- bridges/primitives/chain-wococo/src/lib.rs | 4 +- .../header-chain/src/justification.rs | 248 +++++++++++------- bridges/primitives/header-chain/src/lib.rs | 17 +- .../tests/implementation_match.rs | 28 +- .../header-chain/tests/justification.rs | 99 ++++++- bridges/primitives/messages/src/lib.rs | 5 +- bridges/primitives/polkadot-core/src/lib.rs | 6 +- bridges/primitives/runtime/src/chain.rs | 51 +++- bridges/primitives/runtime/src/lib.rs | 5 +- 28 files changed, 392 insertions(+), 241 deletions(-) diff --git a/bridges/bin/runtime-common/src/integrity.rs b/bridges/bin/runtime-common/src/integrity.rs index 1292a4fbaa3..a0af3b981f3 100644 --- a/bridges/bin/runtime-common/src/integrity.rs +++ b/bridges/bin/runtime-common/src/integrity.rs @@ -38,7 +38,7 @@ macro_rules! assert_chain_types( // if one of asserts fail, then either bridge isn't configured properly (or alternatively - non-standard // configuration is used), or something has broke existing configuration (meaning that all bridged chains // and relays will stop functioning) - use frame_system::{Config as SystemConfig, pallet_prelude::*}; + use frame_system::{Config as SystemConfig, pallet_prelude::{BlockNumberFor, HeaderFor}}; use static_assertions::assert_type_eq_all; assert_type_eq_all!(<$r as SystemConfig>::Nonce, bp_runtime::NonceOf<$this>); diff --git a/bridges/bin/runtime-common/src/mock.rs b/bridges/bin/runtime-common/src/mock.rs index f7e5fc7daa3..6b5edabc886 100644 --- a/bridges/bin/runtime-common/src/mock.rs +++ b/bridges/bin/runtime-common/src/mock.rs @@ -63,7 +63,9 @@ pub type ThisChainHasher = BlakeTwo256; pub type ThisChainRuntimeCall = RuntimeCall; /// Runtime call origin at `ThisChain`. pub type ThisChainCallOrigin = RuntimeOrigin; -// Block of `ThisChain`. +/// Header of `ThisChain`. +pub type ThisChainHeader = sp_runtime::generic::Header; +/// Block of `ThisChain`. pub type ThisChainBlock = frame_system::mocking::MockBlockU32; /// Account identifier at the `BridgedChain`. @@ -79,8 +81,6 @@ pub type BridgedChainHasher = BlakeTwo256; /// Header of the `BridgedChain`. pub type BridgedChainHeader = sp_runtime::generic::Header; -/// Block of the `BridgedChain`. -pub type BridgedChainBlock = frame_system::mocking::MockBlockU32; /// Rewards payment procedure. pub type TestPaymentProcedure = PayRewardFromAccount; @@ -312,9 +312,10 @@ impl From pub struct ThisUnderlyingChain; impl Chain for ThisUnderlyingChain { - type Block = ThisChainBlock; + type BlockNumber = ThisChainBlockNumber; type Hash = ThisChainHash; type Hasher = ThisChainHasher; + type Header = ThisChainHeader; type AccountId = ThisChainAccountId; type Balance = ThisChainBalance; type Nonce = u32; @@ -351,9 +352,10 @@ pub struct BridgedUnderlyingParachain; pub struct BridgedChainCall; impl Chain for BridgedUnderlyingChain { - type Block = BridgedChainBlock; + type BlockNumber = BridgedChainBlockNumber; type Hash = BridgedChainHash; type Hasher = BridgedChainHasher; + type Header = BridgedChainHeader; type AccountId = BridgedChainAccountId; type Balance = BridgedChainBalance; type Nonce = u32; @@ -376,9 +378,10 @@ impl ChainWithGrandpa for BridgedUnderlyingChain { } impl Chain for BridgedUnderlyingParachain { - type Block = BridgedChainBlock; + type BlockNumber = BridgedChainBlockNumber; type Hash = BridgedChainHash; type Hasher = BridgedChainHasher; + type Header = BridgedChainHeader; type AccountId = BridgedChainAccountId; type Balance = BridgedChainBalance; type Nonce = u32; diff --git a/bridges/bin/runtime-common/src/parachains_benchmarking.rs b/bridges/bin/runtime-common/src/parachains_benchmarking.rs index 53095784cb1..aad53673c3a 100644 --- a/bridges/bin/runtime-common/src/parachains_benchmarking.rs +++ b/bridges/bin/runtime-common/src/parachains_benchmarking.rs @@ -46,7 +46,7 @@ where + pallet_bridge_grandpa::Config, PI: 'static, >::BridgedChain: - bp_runtime::Chain, + bp_runtime::Chain, { let parachain_head = ParaHead(vec![0u8; parachain_head_size as usize]); diff --git a/bridges/bin/runtime-common/src/refund_relayer_extension.rs b/bridges/bin/runtime-common/src/refund_relayer_extension.rs index 1beacd981ee..c5419837316 100644 --- a/bridges/bin/runtime-common/src/refund_relayer_extension.rs +++ b/bridges/bin/runtime-common/src/refund_relayer_extension.rs @@ -24,7 +24,7 @@ use crate::messages_call_ext::{ }; use bp_messages::{LaneId, MessageNonce}; use bp_relayers::{RewardsAccountOwner, RewardsAccountParams}; -use bp_runtime::{Chain, Parachain, ParachainIdOf, RangeInclusiveExt, StaticStrProvider}; +use bp_runtime::{Parachain, ParachainIdOf, RangeInclusiveExt, StaticStrProvider}; use codec::{Decode, Encode}; use frame_support::{ dispatch::{CallableCallFor, DispatchInfo, Dispatchable, PostDispatchInfo}, @@ -47,10 +47,7 @@ use pallet_transaction_payment::{Config as TransactionPaymentConfig, OnChargeTra use pallet_utility::{Call as UtilityCall, Config as UtilityConfig, Pallet as UtilityPallet}; use scale_info::TypeInfo; use sp_runtime::{ - traits::{ - Block as BlockT, DispatchInfoOf, Get, Header as HeaderT, PostDispatchInfoOf, - SignedExtension, Zero, - }, + traits::{DispatchInfoOf, Get, PostDispatchInfoOf, SignedExtension, Zero}, transaction_validity::{ TransactionPriority, TransactionValidity, TransactionValidityError, ValidTransactionBuilder, }, @@ -281,7 +278,6 @@ where + GrandpaCallSubType + ParachainsCallSubType + MessagesCallSubType, - <<>::BridgedRelayChain as Chain>::Block as BlockT>::Header: HeaderT { fn expand_call<'a>(&self, call: &'a CallOf) -> Vec<&'a CallOf> { match call.is_sub_type() { @@ -529,7 +525,6 @@ where + GrandpaCallSubType + ParachainsCallSubType + MessagesCallSubType, - <<>::BridgedRelayChain as Chain>::Block as BlockT>::Header: HeaderT { const IDENTIFIER: &'static str = Id::STR; type AccountId = Runtime::AccountId; diff --git a/bridges/modules/grandpa/src/call_ext.rs b/bridges/modules/grandpa/src/call_ext.rs index 868b6626955..c83e88b7b56 100644 --- a/bridges/modules/grandpa/src/call_ext.rs +++ b/bridges/modules/grandpa/src/call_ext.rs @@ -19,7 +19,6 @@ use bp_header_chain::{justification::GrandpaJustification, ChainWithGrandpa}; use bp_runtime::BlockNumberOf; use codec::Encode; use frame_support::{dispatch::CallableCallFor, traits::IsSubType, weights::Weight, RuntimeDebug}; -use frame_system::pallet_prelude::HeaderFor; use sp_runtime::{ traits::{Header, Zero}, transaction_validity::{InvalidTransaction, TransactionValidity, ValidTransaction}, @@ -179,9 +178,10 @@ pub(crate) fn submit_finality_proof_info_from_args, I: 'static>( /// Returns maximal expected size of `submit_finality_proof` call arguments. fn max_expected_call_size, I: 'static>(required_precommits: u32) -> u32 { - let max_expected_justification_size = GrandpaJustification::>::max_reasonable_size::< - T::BridgedChain, - >(required_precommits); + let max_expected_justification_size = + GrandpaJustification::>::max_reasonable_size::( + required_precommits, + ); // call arguments are header and justification T::BridgedChain::MAX_HEADER_SIZE.saturating_add(max_expected_justification_size) diff --git a/bridges/modules/grandpa/src/lib.rs b/bridges/modules/grandpa/src/lib.rs index 8ff128ef20f..eb49849ac88 100644 --- a/bridges/modules/grandpa/src/lib.rs +++ b/bridges/modules/grandpa/src/lib.rs @@ -39,13 +39,12 @@ pub use storage_types::StoredAuthoritySet; use bp_header_chain::{ - justification::GrandpaJustification, ChainWithGrandpa, HeaderChain, InitializationData, - StoredHeaderData, StoredHeaderDataBuilder, + justification::GrandpaJustification, ChainWithGrandpa, GrandpaConsensusLogReader, HeaderChain, + InitializationData, StoredHeaderData, StoredHeaderDataBuilder, }; use bp_runtime::{BlockNumberOf, HashOf, HasherOf, HeaderId, HeaderOf, OwnedBridgeModule}; use finality_grandpa::voter_set::VoterSet; use frame_support::{dispatch::PostDispatchInfo, ensure, DefaultNoBound}; -use sp_consensus_grandpa::{ConsensusLog, GRANDPA_ENGINE_ID}; use sp_runtime::{ traits::{Header as HeaderT, Zero}, SaturatedConversion, @@ -443,11 +442,17 @@ pub mod pallet { // We don't support forced changes - at that point governance intervention is required. ensure!( - super::find_forced_change(header).is_none(), + GrandpaConsensusLogReader::>::find_forced_change( + header.digest() + ) + .is_none(), >::UnsupportedScheduledChange ); - if let Some(change) = super::find_scheduled_change(header) { + if let Some(change) = + GrandpaConsensusLogReader::>::find_scheduled_change( + header.digest(), + ) { // GRANDPA only includes a `delay` for forced changes, so this isn't valid. ensure!(change.delay == Zero::zero(), >::UnsupportedScheduledChange); @@ -616,42 +621,6 @@ impl, I: 'static> HeaderChain> for GrandpaChainH } } -pub(crate) fn find_scheduled_change( - header: &H, -) -> Option> { - use sp_runtime::generic::OpaqueDigestItemId; - - let id = OpaqueDigestItemId::Consensus(&GRANDPA_ENGINE_ID); - - let filter_log = |log: ConsensusLog| match log { - ConsensusLog::ScheduledChange(change) => Some(change), - _ => None, - }; - - // find the first consensus digest with the right ID which converts to - // the right kind of consensus log. - header.digest().convert_first(|l| l.try_to(id).and_then(filter_log)) -} - -/// Checks the given header for a consensus digest signaling a **forced** scheduled change and -/// extracts it. -pub(crate) fn find_forced_change( - header: &H, -) -> Option<(H::Number, sp_consensus_grandpa::ScheduledChange)> { - use sp_runtime::generic::OpaqueDigestItemId; - - let id = OpaqueDigestItemId::Consensus(&GRANDPA_ENGINE_ID); - - let filter_log = |log: ConsensusLog| match log { - ConsensusLog::ForcedChange(delay, change) => Some((delay, change)), - _ => None, - }; - - // find the first consensus digest with the right ID which converts to - // the right kind of consensus log. - header.digest().convert_first(|l| l.try_to(id).and_then(filter_log)) -} - /// (Re)initialize bridge with given header for using it in `pallet-bridge-messages` benchmarks. #[cfg(feature = "runtime-benchmarks")] pub fn initialize_for_benchmarks, I: 'static>(header: BridgedHeader) { @@ -685,6 +654,7 @@ mod tests { storage::generator::StorageValue, }; use frame_system::{EventRecord, Phase}; + use sp_consensus_grandpa::{ConsensusLog, GRANDPA_ENGINE_ID}; use sp_core::Get; use sp_runtime::{Digest, DigestItem, DispatchError}; diff --git a/bridges/modules/grandpa/src/mock.rs b/bridges/modules/grandpa/src/mock.rs index 819875b870a..bd305dfef9d 100644 --- a/bridges/modules/grandpa/src/mock.rs +++ b/bridges/modules/grandpa/src/mock.rs @@ -32,8 +32,8 @@ use sp_runtime::{ }; pub type AccountId = u64; -pub type TestHeader = crate::BridgedHeader; -pub type TestNumber = crate::BridgedBlockNumber; +pub type TestHeader = sp_runtime::testing::Header; +pub type TestNumber = u64; type Block = frame_system::mocking::MockBlock; @@ -100,9 +100,10 @@ impl grandpa::Config for TestRuntime { pub struct TestBridgedChain; impl Chain for TestBridgedChain { - type Block = Block; + type BlockNumber = TestNumber; type Hash = ::Hash; type Hasher = ::Hashing; + type Header = TestHeader; type AccountId = AccountId; type Balance = u64; diff --git a/bridges/modules/parachains/src/benchmarking.rs b/bridges/modules/parachains/src/benchmarking.rs index f89fbb0f361..59c4642cde9 100644 --- a/bridges/modules/parachains/src/benchmarking.rs +++ b/bridges/modules/parachains/src/benchmarking.rs @@ -47,7 +47,7 @@ benchmarks_instance_pallet! { where >::BridgedChain: bp_runtime::Chain< - Block = crate::RelayBlock, + BlockNumber = RelayBlockNumber, Hash = RelayBlockHash, Hasher = RelayBlockHasher, >, diff --git a/bridges/modules/parachains/src/lib.rs b/bridges/modules/parachains/src/lib.rs index 6f28bfc1b08..4f78a45d4b7 100644 --- a/bridges/modules/parachains/src/lib.rs +++ b/bridges/modules/parachains/src/lib.rs @@ -63,8 +63,6 @@ pub type RelayBlockHash = bp_polkadot_core::Hash; pub type RelayBlockNumber = bp_polkadot_core::BlockNumber; /// Hasher of the bridged relay chain. pub type RelayBlockHasher = bp_polkadot_core::Hasher; -/// Block type of the bridged relay chain. -pub type RelayBlock = bp_polkadot_core::Block; /// Artifacts of the parachains head update. struct UpdateParachainHeadArtifacts { @@ -139,15 +137,18 @@ pub mod pallet { pub trait BoundedBridgeGrandpaConfig: pallet_bridge_grandpa::Config { - type BridgedRelayChain: Chain; + type BridgedRelayChain: Chain< + BlockNumber = RelayBlockNumber, + Hash = RelayBlockHash, + Hasher = RelayBlockHasher, + >; } impl BoundedBridgeGrandpaConfig for T where T: pallet_bridge_grandpa::Config, - T::BridgedChain: Chain, - <::Block as sp_runtime::traits::Block>::Header: - sp_runtime::traits::Header, + T::BridgedChain: + Chain, { type BridgedRelayChain = T::BridgedChain; } @@ -322,7 +323,7 @@ pub mod pallet { >::get(relay_block_hash) .ok_or(Error::::UnknownRelayChainBlock)?; ensure!( - relay_block.number == relay_block_number.into(), + relay_block.number == relay_block_number, Error::::InvalidRelayChainBlockNumber, ); diff --git a/bridges/modules/parachains/src/mock.rs b/bridges/modules/parachains/src/mock.rs index c72298a5e1d..a7030f0ae03 100644 --- a/bridges/modules/parachains/src/mock.rs +++ b/bridges/modules/parachains/src/mock.rs @@ -20,7 +20,7 @@ use bp_runtime::{Chain, Parachain}; use frame_support::{construct_runtime, parameter_types, traits::ConstU32, weights::Weight}; use sp_runtime::{ testing::H256, - traits::{BlakeTwo256, Header, IdentityLookup}, + traits::{BlakeTwo256, Header as HeaderT, IdentityLookup}, MultiSignature, Perbill, }; @@ -48,9 +48,10 @@ pub type BigParachainHeader = sp_runtime::generic::Header; pub struct Parachain1; impl Chain for Parachain1 { - type Block = Block; + type BlockNumber = u64; type Hash = H256; type Hasher = RegularParachainHasher; + type Header = RegularParachainHeader; type AccountId = u64; type Balance = u64; type Nonce = u64; @@ -71,9 +72,10 @@ impl Parachain for Parachain1 { pub struct Parachain2; impl Chain for Parachain2 { - type Block = Block; + type BlockNumber = u64; type Hash = H256; type Hasher = RegularParachainHasher; + type Header = RegularParachainHeader; type AccountId = u64; type Balance = u64; type Nonce = u64; @@ -94,9 +96,10 @@ impl Parachain for Parachain2 { pub struct Parachain3; impl Chain for Parachain3 { - type Block = Block; + type BlockNumber = u64; type Hash = H256; type Hasher = RegularParachainHasher; + type Header = RegularParachainHeader; type AccountId = u64; type Balance = u64; type Nonce = u64; @@ -117,12 +120,11 @@ impl Parachain for Parachain3 { // this parachain is using u128 as block number and stored head data size exceeds limit pub struct BigParachain; -type BigBlock = frame_system::mocking::MockBlockU128; - impl Chain for BigParachain { - type Block = BigBlock; + type BlockNumber = u128; type Hash = H256; type Hasher = RegularParachainHasher; + type Header = BigParachainHeader; type AccountId = u64; type Balance = u64; type Nonce = u64; @@ -161,11 +163,11 @@ impl frame_system::Config for TestRuntime { type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; + type Block = Block; type Hash = H256; type Hashing = RegularParachainHasher; type AccountId = AccountId; type Lookup = IdentityLookup; - type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -256,9 +258,10 @@ impl pallet_bridge_parachains::benchmarking::Config<()> for TestRuntime { pub struct TestBridgedChain; impl Chain for TestBridgedChain { - type Block = crate::RelayBlock; + type BlockNumber = crate::RelayBlockNumber; type Hash = crate::RelayBlockHash; type Hasher = crate::RelayBlockHasher; + type Header = RelayBlockHeader; type AccountId = AccountId; type Balance = u32; @@ -286,9 +289,10 @@ impl ChainWithGrandpa for TestBridgedChain { pub struct OtherBridgedChain; impl Chain for OtherBridgedChain { - type Block = Block; + type BlockNumber = u64; type Hash = crate::RelayBlockHash; type Hasher = crate::RelayBlockHasher; + type Header = sp_runtime::generic::Header; type AccountId = AccountId; type Balance = u32; diff --git a/bridges/modules/relayers/src/mock.rs b/bridges/modules/relayers/src/mock.rs index e9ba058bc4c..b3fcb24cdd2 100644 --- a/bridges/modules/relayers/src/mock.rs +++ b/bridges/modules/relayers/src/mock.rs @@ -65,11 +65,11 @@ impl frame_system::Config for TestRuntime { type RuntimeOrigin = RuntimeOrigin; type Nonce = u64; type RuntimeCall = RuntimeCall; + type Block = Block; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = frame_support::traits::ConstU64<250>; type Version = (); diff --git a/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs b/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs index f0826952209..525b2e62cea 100644 --- a/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs +++ b/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs @@ -17,8 +17,8 @@ #![cfg_attr(not(feature = "std"), no_std)] pub use bp_polkadot_core::{ - AccountId, AccountInfoStorageMapKeyProvider, AccountPublic, Balance, Block, BlockNumber, Hash, - Hasher, Hashing, Header, Nonce, Perbill, Signature, SignedBlock, UncheckedExtrinsic, + AccountId, AccountInfoStorageMapKeyProvider, AccountPublic, Balance, BlockNumber, Hash, Hasher, + Hashing, Header, Nonce, Perbill, Signature, SignedBlock, UncheckedExtrinsic, EXTRA_STORAGE_PROOF_SIZE, TX_EXTRA_BYTES, }; @@ -53,7 +53,7 @@ pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// This is a copy-paste from the cumulus repo's `parachains-common` crate. const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(constants::WEIGHT_REF_TIME_PER_SECOND, 0) .saturating_div(2) - .set_proof_size(polkadot_primitives::MAX_POV_SIZE as u64); + .set_proof_size(polkadot_primitives::v5::MAX_POV_SIZE as u64); /// All cumulus bridge hubs assume that about 5 percent of the block weight is consumed by /// `on_initialize` handlers. This is used to limit the maximal weight of a single extrinsic. diff --git a/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs b/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs index ac899256343..7405f561fb2 100644 --- a/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs +++ b/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs @@ -36,9 +36,11 @@ use sp_std::prelude::*; pub struct BridgeHubKusama; impl Chain for BridgeHubKusama { + type BlockNumber = BlockNumber; type Hash = Hash; type Hasher = Hasher; - type Block = Block; + type Header = Header; + type AccountId = AccountId; type Balance = Balance; type Nonce = Nonce; diff --git a/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs b/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs index 76af4b943c4..e1fc0d7bc47 100644 --- a/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs +++ b/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs @@ -32,9 +32,11 @@ use sp_std::prelude::*; pub struct BridgeHubPolkadot; impl Chain for BridgeHubPolkadot { + type BlockNumber = BlockNumber; type Hash = Hash; type Hasher = Hasher; - type Block = Block; + type Header = Header; + type AccountId = AccountId; type Balance = Balance; type Nonce = Nonce; diff --git a/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs b/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs index a11bc6b8e1f..50206c8e6b3 100644 --- a/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs +++ b/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs @@ -36,9 +36,11 @@ use sp_std::prelude::*; pub struct BridgeHubRococo; impl Chain for BridgeHubRococo { + type BlockNumber = BlockNumber; type Hash = Hash; type Hasher = Hasher; - type Block = Block; + type Header = Header; + type AccountId = AccountId; type Balance = Balance; type Nonce = Nonce; diff --git a/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs b/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs index 71010695337..7d14460c737 100644 --- a/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs +++ b/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs @@ -32,9 +32,11 @@ use sp_std::prelude::*; pub struct BridgeHubWococo; impl Chain for BridgeHubWococo { + type BlockNumber = BlockNumber; type Hash = Hash; type Hasher = Hasher; - type Block = Block; + type Header = Header; + type AccountId = AccountId; type Balance = Balance; type Nonce = Nonce; diff --git a/bridges/primitives/chain-kusama/src/lib.rs b/bridges/primitives/chain-kusama/src/lib.rs index e4b5d330354..229905a3d4a 100644 --- a/bridges/primitives/chain-kusama/src/lib.rs +++ b/bridges/primitives/chain-kusama/src/lib.rs @@ -28,9 +28,10 @@ use frame_support::weights::Weight; pub struct Kusama; impl Chain for Kusama { - type Block = ::Block; + type BlockNumber = ::BlockNumber; type Hash = ::Hash; type Hasher = ::Hasher; + type Header = ::Header; type AccountId = ::AccountId; type Balance = ::Balance; diff --git a/bridges/primitives/chain-polkadot/src/lib.rs b/bridges/primitives/chain-polkadot/src/lib.rs index b57486916d2..628634bb46f 100644 --- a/bridges/primitives/chain-polkadot/src/lib.rs +++ b/bridges/primitives/chain-polkadot/src/lib.rs @@ -28,9 +28,10 @@ use frame_support::weights::Weight; pub struct Polkadot; impl Chain for Polkadot { - type Block = ::Block; + type BlockNumber = ::BlockNumber; type Hash = ::Hash; type Hasher = ::Hasher; + type Header = ::Header; type AccountId = ::AccountId; type Balance = ::Balance; diff --git a/bridges/primitives/chain-rococo/src/lib.rs b/bridges/primitives/chain-rococo/src/lib.rs index b8a6b47b423..a825c8b3978 100644 --- a/bridges/primitives/chain-rococo/src/lib.rs +++ b/bridges/primitives/chain-rococo/src/lib.rs @@ -28,9 +28,11 @@ use frame_support::{parameter_types, weights::Weight}; pub struct Rococo; impl Chain for Rococo { - type Block = ::Block; + type BlockNumber = ::BlockNumber; type Hash = ::Hash; type Hasher = ::Hasher; + type Header = ::Header; + type AccountId = ::AccountId; type Balance = ::Balance; type Nonce = ::Nonce; diff --git a/bridges/primitives/chain-wococo/src/lib.rs b/bridges/primitives/chain-wococo/src/lib.rs index 00653267e70..fb63613427d 100644 --- a/bridges/primitives/chain-wococo/src/lib.rs +++ b/bridges/primitives/chain-wococo/src/lib.rs @@ -31,9 +31,11 @@ use frame_support::weights::Weight; pub struct Wococo; impl Chain for Wococo { - type Block = ::Block; + type BlockNumber = ::BlockNumber; type Hash = ::Hash; type Hasher = ::Hasher; + type Header = ::Header; + type AccountId = ::AccountId; type Balance = ::Balance; type Nonce = ::Nonce; diff --git a/bridges/primitives/header-chain/src/justification.rs b/bridges/primitives/header-chain/src/justification.rs index a90f4bab94a..714546a42ef 100644 --- a/bridges/primitives/header-chain/src/justification.rs +++ b/bridges/primitives/header-chain/src/justification.rs @@ -21,10 +21,10 @@ use crate::ChainWithGrandpa; -use bp_runtime::{BlockNumberOf, Chain, HashOf}; +use bp_runtime::{BlockNumberOf, Chain, HashOf, HeaderId}; use codec::{Decode, Encode, MaxEncodedLen}; use finality_grandpa::voter_set::VoterSet; -use frame_support::RuntimeDebug; +use frame_support::{RuntimeDebug, RuntimeDebugNoBound}; use scale_info::TypeInfo; use sp_consensus_grandpa::{AuthorityId, AuthoritySignature, SetId}; use sp_runtime::{traits::Header as HeaderT, SaturatedConversion}; @@ -38,7 +38,7 @@ use sp_std::{ /// /// This particular proof is used to prove that headers on a bridged chain /// (so not our chain) have been finalized correctly. -#[derive(Encode, Decode, Clone, PartialEq, Eq, TypeInfo)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, TypeInfo, RuntimeDebugNoBound)] pub struct GrandpaJustification { /// The round (voting period) this justification is valid for. pub round: u64, @@ -49,25 +49,6 @@ pub struct GrandpaJustification { pub votes_ancestries: Vec
, } -// TODO: remove and use `RuntimeDebug` (https://github.com/paritytech/parity-bridges-common/issues/2136) -impl sp_std::fmt::Debug for GrandpaJustification
{ - fn fmt(&self, fmt: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { - #[cfg(feature = "std")] - { - fmt.debug_struct("GrandpaJustification") - .field("round", &self.round) - .field("commit", &self.commit) - .field("votes_ancestries", &self.votes_ancestries) - .finish() - } - - #[cfg(not(feature = "std"))] - { - fmt.write_str("") - } - } -} - impl GrandpaJustification { /// Returns reasonable size of justification using constants from the provided chain. /// @@ -103,6 +84,10 @@ impl GrandpaJustification { 8u32.saturating_add(max_expected_signed_commit_size) .saturating_add(max_expected_votes_ancestries_size) } + + pub fn commit_target_id(&self) -> HeaderId { + HeaderId(self.commit.target_number, self.commit.target_hash) + } } impl crate::FinalityProof for GrandpaJustification { @@ -128,12 +113,12 @@ pub enum Error { InvalidAuthoritySignature, /// The justification contains precommit for header that is not a descendant of the commit /// header. - PrecommitIsNotCommitDescendant, + UnrelatedAncestryVote, /// The cumulative weight of all votes in the justification is not enough to justify commit /// header finalization. TooLowCumulativeWeight, /// The justification contains extra (unused) headers in its `votes_ancestries` field. - ExtraHeadersInVotesAncestries, + RedundantVotesAncestries, } /// Given GRANDPA authorities set size, return number of valid authorities votes that the @@ -158,17 +143,22 @@ pub fn verify_and_optimize_justification( finalized_target: (Header::Hash, Header::Number), authorities_set_id: SetId, authorities_set: &VoterSet, - justification: GrandpaJustification
, -) -> Result, Error> { - let mut optimizer = OptimizationCallbacks(Vec::new()); + justification: &mut GrandpaJustification
, +) -> Result<(), Error> { + let mut optimizer = OptimizationCallbacks { + extra_precommits: vec![], + redundant_votes_ancestries: Default::default(), + }; verify_justification_with_callbacks( finalized_target, authorities_set_id, authorities_set, - &justification, + justification, &mut optimizer, )?; - Ok(optimizer.optimize(justification)) + optimizer.optimize(justification); + + Ok(()) } /// Verify that justification, that is generated by given authority set, finalizes given header. @@ -188,19 +178,28 @@ pub fn verify_justification( } /// Verification callbacks. -trait VerificationCallbacks { +trait VerificationCallbacks { /// Called when we see a precommit from unknown authority. fn on_unkown_authority(&mut self, precommit_idx: usize) -> Result<(), Error>; /// Called when we see a precommit with duplicate vote from known authority. fn on_duplicate_authority_vote(&mut self, precommit_idx: usize) -> Result<(), Error>; + /// Called when we see a precommit with an invalid signature. + fn on_invalid_authority_signature(&mut self, precommit_idx: usize) -> Result<(), Error>; /// Called when we see a precommit after we've collected enough votes from authorities. fn on_redundant_authority_vote(&mut self, precommit_idx: usize) -> Result<(), Error>; + /// Called when we see a precommit that is not a descendant of the commit target. + fn on_unrelated_ancestry_vote(&mut self, precommit_idx: usize) -> Result<(), Error>; + /// Called when there are redundant headers in the votes ancestries. + fn on_redundant_votes_ancestries( + &mut self, + redundant_votes_ancestries: BTreeSet, + ) -> Result<(), Error>; } /// Verification callbacks that reject all unknown, duplicate or redundant votes. struct StrictVerificationCallbacks; -impl VerificationCallbacks for StrictVerificationCallbacks { +impl VerificationCallbacks
for StrictVerificationCallbacks { fn on_unkown_authority(&mut self, _precommit_idx: usize) -> Result<(), Error> { Err(Error::UnknownAuthorityVote) } @@ -209,45 +208,82 @@ impl VerificationCallbacks for StrictVerificationCallbacks { Err(Error::DuplicateAuthorityVote) } + fn on_invalid_authority_signature(&mut self, _precommit_idx: usize) -> Result<(), Error> { + Err(Error::InvalidAuthoritySignature) + } + fn on_redundant_authority_vote(&mut self, _precommit_idx: usize) -> Result<(), Error> { Err(Error::RedundantVotesInJustification) } + + fn on_unrelated_ancestry_vote(&mut self, _precommit_idx: usize) -> Result<(), Error> { + Err(Error::UnrelatedAncestryVote) + } + + fn on_redundant_votes_ancestries( + &mut self, + _redundant_votes_ancestries: BTreeSet, + ) -> Result<(), Error> { + Err(Error::RedundantVotesAncestries) + } } /// Verification callbacks for justification optimization. -struct OptimizationCallbacks(Vec); - -impl OptimizationCallbacks { - fn optimize( - self, - mut justification: GrandpaJustification
, - ) -> GrandpaJustification
{ - for invalid_precommit_idx in self.0.into_iter().rev() { +struct OptimizationCallbacks { + extra_precommits: Vec, + redundant_votes_ancestries: BTreeSet, +} + +impl OptimizationCallbacks
{ + fn optimize(self, justification: &mut GrandpaJustification
) { + for invalid_precommit_idx in self.extra_precommits.into_iter().rev() { justification.commit.precommits.remove(invalid_precommit_idx); } - justification + if !self.redundant_votes_ancestries.is_empty() { + justification + .votes_ancestries + .retain(|header| !self.redundant_votes_ancestries.contains(&header.hash())) + } } } -impl VerificationCallbacks for OptimizationCallbacks { +impl VerificationCallbacks
for OptimizationCallbacks
{ fn on_unkown_authority(&mut self, precommit_idx: usize) -> Result<(), Error> { - self.0.push(precommit_idx); + self.extra_precommits.push(precommit_idx); Ok(()) } fn on_duplicate_authority_vote(&mut self, precommit_idx: usize) -> Result<(), Error> { - self.0.push(precommit_idx); + self.extra_precommits.push(precommit_idx); + Ok(()) + } + + fn on_invalid_authority_signature(&mut self, precommit_idx: usize) -> Result<(), Error> { + self.extra_precommits.push(precommit_idx); Ok(()) } fn on_redundant_authority_vote(&mut self, precommit_idx: usize) -> Result<(), Error> { - self.0.push(precommit_idx); + self.extra_precommits.push(precommit_idx); + Ok(()) + } + + fn on_unrelated_ancestry_vote(&mut self, precommit_idx: usize) -> Result<(), Error> { + self.extra_precommits.push(precommit_idx); + Ok(()) + } + + fn on_redundant_votes_ancestries( + &mut self, + redundant_votes_ancestries: BTreeSet, + ) -> Result<(), Error> { + self.redundant_votes_ancestries = redundant_votes_ancestries; Ok(()) } } /// Verify that justification, that is generated by given authority set, finalizes given header. -fn verify_justification_with_callbacks( +fn verify_justification_with_callbacks>( finalized_target: (Header::Hash, Header::Number), authorities_set_id: SetId, authorities_set: &VoterSet, @@ -259,8 +295,8 @@ fn verify_justification_with_callbacks route, + None => { + callbacks.on_unrelated_ancestry_vote(precommit_idx)?; + continue + }, + }; // verify authority signature if !sp_consensus_grandpa::check_message_signature_with_buffer( @@ -325,76 +347,98 @@ fn verify_justification_with_callbacks= threshold { - Ok(()) - } else { - Err(Error::TooLowCumulativeWeight) + // check that there are no extra headers in the justification + if !chain.is_fully_visited() { + callbacks.on_redundant_votes_ancestries(chain.unvisited)?; } + + Ok(()) } /// Votes ancestries with useful methods. #[derive(RuntimeDebug)] pub struct AncestryChain { + /// We expect all forks in the ancestry chain to be descendants of base. + base: HeaderId, /// Header hash => parent header hash mapping. pub parents: BTreeMap, - /// Hashes of headers that were not visited by `is_ancestor` method. + /// Hashes of headers that were not visited by `ancestry()`. pub unvisited: BTreeSet, } impl AncestryChain
{ /// Create new ancestry chain. - pub fn new(ancestry: &[Header]) -> AncestryChain
{ + pub fn new(justification: &GrandpaJustification
) -> AncestryChain
{ let mut parents = BTreeMap::new(); let mut unvisited = BTreeSet::new(); - for ancestor in ancestry { + for ancestor in &justification.votes_ancestries { let hash = ancestor.hash(); let parent_hash = *ancestor.parent_hash(); parents.insert(hash, parent_hash); unvisited.insert(hash); } - AncestryChain { parents, unvisited } + AncestryChain { base: justification.commit_target_id(), parents, unvisited } } - /// Returns `Ok(_)` if `precommit_target` is a descendant of the `commit_target` block and - /// `Err(_)` otherwise. - pub fn ensure_descendant( - mut self, - commit_target: &Header::Hash, - precommit_target: &Header::Hash, - ) -> Result { - let mut current_hash = *precommit_target; + /// Returns a route if the precommit target block is a descendant of the `base` block. + pub fn ancestry( + &self, + precommit_target_hash: &Header::Hash, + precommit_target_number: &Header::Number, + ) -> Option> { + if precommit_target_number < &self.base.number() { + return None + } + + let mut route = vec![]; + let mut current_hash = *precommit_target_hash; loop { - if current_hash == *commit_target { + if current_hash == self.base.hash() { break } - let is_visited_before = !self.unvisited.remove(¤t_hash); current_hash = match self.parents.get(¤t_hash) { Some(parent_hash) => { + let is_visited_before = self.unvisited.get(¤t_hash).is_none(); if is_visited_before { - // `Some(parent_hash)` means that the `current_hash` is in the `parents` - // container `is_visited_before` means that it has been visited before in - // some of previous calls => since we assume that previous call has finished - // with `true`, this also will be finished with `true` - return Ok(self) + // If the current header has been visited in a previous call, it is a + // descendent of `base` (we assume that the previous call was successful). + return Some(route) } + route.push(current_hash); *parent_hash }, - None => return Err(Error::PrecommitIsNotCommitDescendant), + None => return None, }; } - Ok(self) + + Some(route) + } + + fn mark_route_as_visited(&mut self, route: Vec) { + for hash in route { + self.unvisited.remove(&hash); + } + } + + fn is_fully_visited(&self) -> bool { + self.unvisited.is_empty() } } diff --git a/bridges/primitives/header-chain/src/lib.rs b/bridges/primitives/header-chain/src/lib.rs index cf08a936234..5268e7d5c5f 100644 --- a/bridges/primitives/header-chain/src/lib.rs +++ b/bridges/primitives/header-chain/src/lib.rs @@ -139,7 +139,7 @@ pub trait ConsensusLogReader { pub struct GrandpaConsensusLogReader(sp_std::marker::PhantomData); impl GrandpaConsensusLogReader { - pub fn find_authorities_change( + pub fn find_scheduled_change( digest: &Digest, ) -> Option> { // find the first consensus digest with the right ID which converts to @@ -151,11 +151,24 @@ impl GrandpaConsensusLogReader { _ => None, }) } + + pub fn find_forced_change( + digest: &Digest, + ) -> Option<(Number, sp_consensus_grandpa::ScheduledChange)> { + // find the first consensus digest with the right ID which converts to + // the right kind of consensus log. + digest + .convert_first(|log| log.consensus_try_to(&GRANDPA_ENGINE_ID)) + .and_then(|log| match log { + ConsensusLog::ForcedChange(delay, change) => Some((delay, change)), + _ => None, + }) + } } impl ConsensusLogReader for GrandpaConsensusLogReader { fn schedules_authorities_change(digest: &Digest) -> bool { - GrandpaConsensusLogReader::::find_authorities_change(digest).is_some() + GrandpaConsensusLogReader::::find_scheduled_change(digest).is_some() } } diff --git a/bridges/primitives/header-chain/tests/implementation_match.rs b/bridges/primitives/header-chain/tests/implementation_match.rs index 22f690b8cb2..d5e42e21497 100644 --- a/bridges/primitives/header-chain/tests/implementation_match.rs +++ b/bridges/primitives/header-chain/tests/implementation_match.rs @@ -38,8 +38,8 @@ type TestNumber = ::Number; struct AncestryChain(bp_header_chain::justification::AncestryChain); impl AncestryChain { - fn new(ancestry: &[TestHeader]) -> Self { - Self(bp_header_chain::justification::AncestryChain::new(ancestry)) + fn new(justification: &GrandpaJustification) -> Self { + Self(bp_header_chain::justification::AncestryChain::new(justification)) } } @@ -55,9 +55,9 @@ impl finality_grandpa::Chain for AncestryChain { if current_hash == base { break } - match self.0.parents.get(¤t_hash).cloned() { + match self.0.parents.get(¤t_hash) { Some(parent_hash) => { - current_hash = parent_hash; + current_hash = *parent_hash; route.push(current_hash); }, _ => return Err(finality_grandpa::Error::NotDescendent), @@ -124,7 +124,7 @@ fn same_result_when_precommit_target_has_lower_number_than_commit_target() { &full_voter_set(), &justification, ), - Err(Error::PrecommitIsNotCommitDescendant), + Err(Error::UnrelatedAncestryVote), ); // original implementation returns `Ok(validation_result)` @@ -132,7 +132,7 @@ fn same_result_when_precommit_target_has_lower_number_than_commit_target() { let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); @@ -157,7 +157,7 @@ fn same_result_when_precommit_target_is_not_descendant_of_commit_target() { &full_voter_set(), &justification, ), - Err(Error::PrecommitIsNotCommitDescendant), + Err(Error::UnrelatedAncestryVote), ); // original implementation returns `Ok(validation_result)` @@ -165,7 +165,7 @@ fn same_result_when_precommit_target_is_not_descendant_of_commit_target() { let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); @@ -198,7 +198,7 @@ fn same_result_when_there_are_not_enough_cumulative_weight_to_finalize_commit_ta let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); @@ -236,7 +236,7 @@ fn different_result_when_justification_contains_duplicate_vote() { let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); @@ -277,7 +277,7 @@ fn different_results_when_authority_equivocates_once_in_a_round() { let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); @@ -330,7 +330,7 @@ fn different_results_when_authority_equivocates_twice_in_a_round() { let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); @@ -369,7 +369,7 @@ fn different_results_when_there_are_more_than_enough_votes() { let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); @@ -410,7 +410,7 @@ fn different_results_when_there_is_a_vote_of_unknown_authority() { let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); diff --git a/bridges/primitives/header-chain/tests/justification.rs b/bridges/primitives/header-chain/tests/justification.rs index 3cd63b935d0..26ed67fa65f 100644 --- a/bridges/primitives/header-chain/tests/justification.rs +++ b/bridges/primitives/header-chain/tests/justification.rs @@ -21,6 +21,8 @@ use bp_header_chain::justification::{ Error, }; use bp_test_utils::*; +use finality_grandpa::SignedPrecommit; +use sp_consensus_grandpa::AuthoritySignature; type TestHeader = sp_runtime::testing::Header; @@ -133,7 +135,7 @@ fn justification_with_invalid_commit_rejected() { &voter_set(), &justification, ), - Err(Error::ExtraHeadersInVotesAncestries), + Err(Error::TooLowCumulativeWeight), ); } @@ -166,7 +168,7 @@ fn justification_with_invalid_precommit_ancestry() { &voter_set(), &justification, ), - Err(Error::ExtraHeadersInVotesAncestries), + Err(Error::RedundantVotesAncestries), ); } @@ -197,14 +199,14 @@ fn justification_is_invalid_if_we_dont_meet_threshold() { #[test] fn optimizer_does_noting_with_minimal_justification() { - let justification = make_default_justification::(&test_header(1)); + let mut justification = make_default_justification::(&test_header(1)); let num_precommits_before = justification.commit.precommits.len(); - let justification = verify_and_optimize_justification::( + verify_and_optimize_justification::( header_id::(1), TEST_GRANDPA_SET_ID, &voter_set(), - justification, + &mut justification, ) .unwrap(); let num_precommits_after = justification.commit.precommits.len(); @@ -223,11 +225,11 @@ fn unknown_authority_votes_are_removed_by_optimizer() { )); let num_precommits_before = justification.commit.precommits.len(); - let justification = verify_and_optimize_justification::( + verify_and_optimize_justification::( header_id::(1), TEST_GRANDPA_SET_ID, &voter_set(), - justification, + &mut justification, ) .unwrap(); let num_precommits_after = justification.commit.precommits.len(); @@ -244,11 +246,42 @@ fn duplicate_authority_votes_are_removed_by_optimizer() { .push(justification.commit.precommits.first().cloned().unwrap()); let num_precommits_before = justification.commit.precommits.len(); - let justification = verify_and_optimize_justification::( + verify_and_optimize_justification::( header_id::(1), TEST_GRANDPA_SET_ID, &voter_set(), - justification, + &mut justification, + ) + .unwrap(); + let num_precommits_after = justification.commit.precommits.len(); + + assert_eq!(num_precommits_before - 1, num_precommits_after); +} + +#[test] +fn invalid_authority_signatures_are_removed_by_optimizer() { + let mut justification = make_default_justification::(&test_header(1)); + + let target = header_id::(1); + let invalid_raw_signature: Vec = ALICE.sign(b"").to_bytes().into(); + justification.commit.precommits.insert( + 0, + SignedPrecommit { + precommit: finality_grandpa::Precommit { + target_hash: target.0, + target_number: target.1, + }, + signature: AuthoritySignature::try_from(invalid_raw_signature).unwrap(), + id: ALICE.into(), + }, + ); + + let num_precommits_before = justification.commit.precommits.len(); + verify_and_optimize_justification::( + header_id::(1), + TEST_GRANDPA_SET_ID, + &voter_set(), + &mut justification, ) .unwrap(); let num_precommits_after = justification.commit.precommits.len(); @@ -267,14 +300,58 @@ fn redundant_authority_votes_are_removed_by_optimizer() { )); let num_precommits_before = justification.commit.precommits.len(); - let justification = verify_and_optimize_justification::( + verify_and_optimize_justification::( header_id::(1), TEST_GRANDPA_SET_ID, &voter_set(), - justification, + &mut justification, ) .unwrap(); let num_precommits_after = justification.commit.precommits.len(); assert_eq!(num_precommits_before - 1, num_precommits_after); } + +#[test] +fn unrelated_ancestry_votes_are_removed_by_optimizer() { + let mut justification = make_default_justification::(&test_header(2)); + justification.commit.precommits.insert( + 0, + signed_precommit::( + &ALICE, + header_id::(1), + justification.round, + TEST_GRANDPA_SET_ID, + ), + ); + + let num_precommits_before = justification.commit.precommits.len(); + verify_and_optimize_justification::( + header_id::(2), + TEST_GRANDPA_SET_ID, + &voter_set(), + &mut justification, + ) + .unwrap(); + let num_precommits_after = justification.commit.precommits.len(); + + assert_eq!(num_precommits_before - 1, num_precommits_after); +} + +#[test] +fn redundant_votes_ancestries_are_removed_by_optimizer() { + let mut justification = make_default_justification::(&test_header(1)); + justification.votes_ancestries.push(test_header(100)); + + let num_votes_ancestries_before = justification.votes_ancestries.len(); + verify_and_optimize_justification::( + header_id::(1), + TEST_GRANDPA_SET_ID, + &voter_set(), + &mut justification, + ) + .unwrap(); + let num_votes_ancestries_after = justification.votes_ancestries.len(); + + assert_eq!(num_votes_ancestries_before - 1, num_votes_ancestries_after); +} diff --git a/bridges/primitives/messages/src/lib.rs b/bridges/primitives/messages/src/lib.rs index 3df039d7eb8..cb3a14572d7 100644 --- a/bridges/primitives/messages/src/lib.rs +++ b/bridges/primitives/messages/src/lib.rs @@ -30,6 +30,7 @@ use frame_support::{PalletError, RuntimeDebug}; // Weight is reexported to avoid additional frame-support dependencies in related crates. pub use frame_support::weights::Weight; use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; use source_chain::RelayersRewards; use sp_core::TypeId; use sp_std::{collections::vec_deque::VecDeque, ops::RangeInclusive, prelude::*}; @@ -49,8 +50,8 @@ pub mod target_chain; RuntimeDebug, TypeInfo, MaxEncodedLen, - serde::Serialize, - serde::Deserialize, + Serialize, + Deserialize, )] pub enum MessagesOperatingMode { /// Basic operating mode (Normal/Halted) diff --git a/bridges/primitives/polkadot-core/src/lib.rs b/bridges/primitives/polkadot-core/src/lib.rs index 2f812a79538..ffd48d8a389 100644 --- a/bridges/primitives/polkadot-core/src/lib.rs +++ b/bridges/primitives/polkadot-core/src/lib.rs @@ -202,7 +202,7 @@ pub type AccountId = ::AccountId; /// Address of account on Polkadot-like chains. pub type AccountAddress = MultiAddress; -/// Index of a transaction on the Polkadot-like chains. +/// Nonce of a transaction on the Polkadot-like chains. pub type Nonce = u32; /// Block type of Polkadot-like chains. @@ -226,9 +226,11 @@ pub type Address = MultiAddress; pub struct PolkadotLike; impl Chain for PolkadotLike { + type BlockNumber = BlockNumber; type Hash = Hash; type Hasher = Hasher; - type Block = Block; + type Header = Header; + type AccountId = AccountId; type Balance = Balance; type Nonce = Nonce; diff --git a/bridges/primitives/runtime/src/chain.rs b/bridges/primitives/runtime/src/chain.rs index fa0d82311e3..8c47662a7c1 100644 --- a/bridges/primitives/runtime/src/chain.rs +++ b/bridges/primitives/runtime/src/chain.rs @@ -14,18 +14,18 @@ // You should have received a copy of the GNU General Public License // along with Parity Bridges Common. If not, see . +use crate::HeaderIdProvider; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{weights::Weight, Parameter}; -use num_traits::{Bounded, CheckedSub, SaturatingAdd, Zero}; +use num_traits::{AsPrimitive, Bounded, CheckedSub, Saturating, SaturatingAdd, Zero}; use sp_runtime::{ traits::{ - AtLeast32Bit, AtLeast32BitUnsigned, Block as BlockT, Hash as HashT, Header as HeaderT, - HeaderProvider, MaybeDisplay, MaybeSerialize, MaybeSerializeDeserialize, Member, - SimpleBitOps, Verify, + AtLeast32Bit, AtLeast32BitUnsigned, Hash as HashT, Header as HeaderT, MaybeDisplay, + MaybeSerialize, MaybeSerializeDeserialize, Member, SimpleBitOps, Verify, }, FixedPointOperand, }; -use sp_std::{convert::TryFrom, fmt::Debug, hash::Hash, vec, vec::Vec}; +use sp_std::{convert::TryFrom, fmt::Debug, hash::Hash, str::FromStr, vec, vec::Vec}; /// Chain call, that is either SCALE-encoded, or decoded. #[derive(Debug, Clone, PartialEq)] @@ -91,6 +91,27 @@ impl Encode for EncodedOrDecodedCall { /// Minimal Substrate-based chain representation that may be used from no_std environment. pub trait Chain: Send + Sync + 'static { + /// A type that fulfills the abstract idea of what a Substrate block number is. + // Constraits come from the associated Number type of `sp_runtime::traits::Header` + // See here for more info: + // https://crates.parity.io/sp_runtime/traits/trait.Header.html#associatedtype.Number + // + // Note that the `AsPrimitive` trait is required by the GRANDPA justification + // verifier, and is not usually part of a Substrate Header's Number type. + type BlockNumber: Parameter + + Member + + MaybeSerializeDeserialize + + Hash + + Copy + + Default + + MaybeDisplay + + AtLeast32BitUnsigned + + FromStr + + AsPrimitive + + Default + + Saturating + + MaxEncodedLen; + /// A type that fulfills the abstract idea of what a Substrate hash is. // Constraits come from the associated Hash type of `sp_runtime::traits::Header` // See here for more info: @@ -115,10 +136,13 @@ pub trait Chain: Send + Sync + 'static { // https://crates.parity.io/sp_runtime/traits/trait.Header.html#associatedtype.Hashing type Hasher: HashT; - /// A type that fulfills the abstract idea of what a Substrate block is. + /// A type that fulfills the abstract idea of what a Substrate header is. // See here for more info: - // https://crates.parity.io/sp_runtime/traits/trait.Block.html - type Block: Parameter + BlockT + MaybeSerialize; + // https://crates.parity.io/sp_runtime/traits/trait.Header.html + type Header: Parameter + + HeaderT + + HeaderIdProvider + + MaybeSerializeDeserialize; /// The user account identifier type for the runtime. type AccountId: Parameter @@ -146,7 +170,7 @@ pub trait Chain: Send + Sync + 'static { + Zero + TryFrom + MaxEncodedLen; - /// Index of a transaction used by the chain. + /// Nonce of a transaction used by the chain. type Nonce: Parameter + Member + MaybeSerialize @@ -176,9 +200,10 @@ impl Chain for T where T: Send + Sync + 'static + UnderlyingChainProvider, { + type BlockNumber = ::BlockNumber; type Hash = ::Hash; type Hasher = ::Hasher; - type Block = ::Block; + type Header = ::Header; type AccountId = ::AccountId; type Balance = ::Balance; type Nonce = ::Nonce; @@ -219,7 +244,7 @@ impl frame_support::traits::Get for ParachainIdOf { pub type UnderlyingChainOf = ::Chain; /// Block number used by the chain. -pub type BlockNumberOf = <<::Block as HeaderProvider>::HeaderT as HeaderT>::Number; +pub type BlockNumberOf = ::BlockNumber; /// Hash type used by the chain. pub type HashOf = ::Hash; @@ -228,7 +253,7 @@ pub type HashOf = ::Hash; pub type HasherOf = ::Hasher; /// Header type used by the chain. -pub type HeaderOf = <::Block as HeaderProvider>::HeaderT; +pub type HeaderOf = ::Header; /// Account id type used by the chain. pub type AccountIdOf = ::AccountId; @@ -236,7 +261,7 @@ pub type AccountIdOf = ::AccountId; /// Balance type used by the chain. pub type BalanceOf = ::Balance; -/// Transaction index type used by the chain. +/// Transaction nonce type used by the chain. pub type NonceOf = ::Nonce; /// Signature type used by the chain. diff --git a/bridges/primitives/runtime/src/lib.rs b/bridges/primitives/runtime/src/lib.rs index 7ba20e11e22..c394af37fa4 100644 --- a/bridges/primitives/runtime/src/lib.rs +++ b/bridges/primitives/runtime/src/lib.rs @@ -25,6 +25,7 @@ use frame_support::{ }; use frame_system::RawOrigin; use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; use sp_core::storage::StorageKey; use sp_runtime::traits::{BadOrigin, Header as HeaderT, UniqueSaturatedInto}; use sp_std::{convert::TryFrom, fmt::Debug, ops::RangeInclusive, vec, vec::Vec}; @@ -383,8 +384,8 @@ pub trait OperatingMode: Send + Copy + Debug + FullCodec { RuntimeDebug, TypeInfo, MaxEncodedLen, - serde::Serialize, - serde::Deserialize, + Serialize, + Deserialize, )] pub enum BasicOperatingMode { /// Normal mode, when all operations are allowed. From a05c09c6d525d7ab62e95643666154b8b0abb546 Mon Sep 17 00:00:00 2001 From: georgepisaltu <52418509+georgepisaltu@users.noreply.github.com> Date: Thu, 20 Jul 2023 15:09:12 +0300 Subject: [PATCH 05/17] Use `benchmarking::v2` in collator selection pallet (#2904) * Use benchmarking v2 in collator selection pallet Signed-off-by: georgepisaltu * Use extrinsic_call syntax Signed-off-by: Oliver Tale-Yazdi * Replace `block` with `extrinsic_call` syntax Signed-off-by: georgepisaltu --------- Signed-off-by: georgepisaltu Signed-off-by: Oliver Tale-Yazdi Co-authored-by: Oliver Tale-Yazdi --- .../collator-selection/src/benchmarking.rs | 188 ++++++++++-------- 1 file changed, 100 insertions(+), 88 deletions(-) diff --git a/pallets/collator-selection/src/benchmarking.rs b/pallets/collator-selection/src/benchmarking.rs index 816e2cd1d72..5fc92f8a783 100644 --- a/pallets/collator-selection/src/benchmarking.rs +++ b/pallets/collator-selection/src/benchmarking.rs @@ -15,15 +15,16 @@ //! Benchmarking setup for pallet-collator-selection +#![cfg(feature = "runtime-benchmarks")] + use super::*; #[allow(unused)] use crate::Pallet as CollatorSelection; use frame_benchmarking::{ - account, benchmarks, impl_benchmark_test_suite, whitelisted_caller, BenchmarkError, + account, impl_benchmark_test_suite, v2::*, whitelisted_caller, BenchmarkError, }; use frame_support::{ - assert_ok, codec::Decode, dispatch::DispatchResult, traits::{Currency, EnsureOrigin, Get, ReservableCurrency}, @@ -38,15 +39,6 @@ pub type BalanceOf = const SEED: u32 = 0; -// TODO: remove if this is given in substrate commit. -macro_rules! whitelist { - ($acc:ident) => { - frame_benchmarking::benchmarking::add_to_whitelist( - frame_system::Account::::hashed_key_for(&$acc).into(), - ); - }; -} - fn assert_last_event(generic_event: ::RuntimeEvent) { let events = frame_system::Pallet::::events(); let system_event: ::RuntimeEvent = generic_event.into(); @@ -119,31 +111,36 @@ fn min_invulnerables() -> u32 { min_collators.saturating_sub(candidates_length.try_into().unwrap()) } -benchmarks! { - where_clause { where T: pallet_authorship::Config + session::Config } +#[benchmarks(where T: pallet_authorship::Config + session::Config)] +mod benchmarks { + use super::*; - set_invulnerables { + #[benchmark] + fn set_invulnerables( + b: Linear<1, { T::MaxInvulnerables::get() }>, + ) -> Result<(), BenchmarkError> { let origin = T::UpdateOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let b in 1 .. T::MaxInvulnerables::get(); + let new_invulnerables = register_validators::(b); let mut sorted_new_invulnerables = new_invulnerables.clone(); sorted_new_invulnerables.sort(); - }: { - assert_ok!( - // call the function with the unsorted list - >::set_invulnerables(origin, new_invulnerables.clone()) - ); - } - verify { + + #[extrinsic_call] + _(origin as T::RuntimeOrigin, new_invulnerables.clone()); + // assert that it comes out sorted - assert_last_event::(Event::NewInvulnerables{invulnerables: sorted_new_invulnerables}.into()); + assert_last_event::( + Event::NewInvulnerables { invulnerables: sorted_new_invulnerables }.into(), + ); + Ok(()) } - add_invulnerable { - let b in 1 .. T::MaxInvulnerables::get() - 1; - let c in 1 .. T::MaxCandidates::get() - 1; - + #[benchmark] + fn add_invulnerable( + b: Linear<1, { T::MaxInvulnerables::get() - 1 }>, + c: Linear<1, { T::MaxCandidates::get() - 1 }>, + ) -> Result<(), BenchmarkError> { let origin = T::UpdateOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; @@ -159,7 +156,8 @@ benchmarks! { candidates.push((new_invulnerable.clone(), new_invulnerable_keys)); // set their keys ... for (who, keys) in candidates.clone() { - >::set_keys(RawOrigin::Signed(who).into(), keys, Vec::new()).unwrap(); + >::set_keys(RawOrigin::Signed(who).into(), keys, Vec::new()) + .unwrap(); } // ... and register them. for (who, _) in candidates { @@ -176,7 +174,8 @@ benchmarks! { ); } Ok(()) - }).expect("only returns ok"); + }) + .expect("only returns ok"); } // now we need to fill up invulnerables @@ -185,65 +184,64 @@ benchmarks! { let invulnerables: frame_support::BoundedVec<_, T::MaxInvulnerables> = frame_support::BoundedVec::try_from(invulnerables).unwrap(); >::put(invulnerables); - }: { - assert_ok!( - >::add_invulnerable(origin, new_invulnerable.clone()) - ); - } - verify { - assert_last_event::(Event::InvulnerableAdded{account_id: new_invulnerable}.into()); + + #[extrinsic_call] + _(origin as T::RuntimeOrigin, new_invulnerable.clone()); + + assert_last_event::(Event::InvulnerableAdded { account_id: new_invulnerable }.into()); + Ok(()) } - remove_invulnerable { + #[benchmark] + fn remove_invulnerable( + b: Linear<{ min_invulnerables::() + 1 }, { T::MaxInvulnerables::get() }>, + ) -> Result<(), BenchmarkError> { let origin = T::UpdateOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - let b in (min_invulnerables::() + 1) .. T::MaxInvulnerables::get(); let mut invulnerables = register_validators::(b); invulnerables.sort(); let invulnerables: frame_support::BoundedVec<_, T::MaxInvulnerables> = frame_support::BoundedVec::try_from(invulnerables).unwrap(); >::put(invulnerables); let to_remove = >::get().first().unwrap().clone(); - }: { - assert_ok!( - >::remove_invulnerable(origin, to_remove.clone()) - ); - } - verify { - assert_last_event::(Event::InvulnerableRemoved{account_id: to_remove}.into()); + + #[extrinsic_call] + _(origin as T::RuntimeOrigin, to_remove.clone()); + + assert_last_event::(Event::InvulnerableRemoved { account_id: to_remove }.into()); + Ok(()) } - set_desired_candidates { + #[benchmark] + fn set_desired_candidates() -> Result<(), BenchmarkError> { let max: u32 = T::MaxCandidates::get(); let origin = T::UpdateOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - }: { - assert_ok!( - >::set_desired_candidates(origin, max) - ); - } - verify { - assert_last_event::(Event::NewDesiredCandidates{desired_candidates: max}.into()); + + #[extrinsic_call] + _(origin as T::RuntimeOrigin, max); + + assert_last_event::(Event::NewDesiredCandidates { desired_candidates: max }.into()); + Ok(()) } - set_candidacy_bond { + #[benchmark] + fn set_candidacy_bond() -> Result<(), BenchmarkError> { let bond_amount: BalanceOf = T::Currency::minimum_balance() * 10u32.into(); let origin = T::UpdateOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?; - }: { - assert_ok!( - >::set_candidacy_bond(origin, bond_amount) - ); - } - verify { - assert_last_event::(Event::NewCandidacyBond{bond_amount}.into()); + + #[extrinsic_call] + _(origin as T::RuntimeOrigin, bond_amount); + + assert_last_event::(Event::NewCandidacyBond { bond_amount }.into()); + Ok(()) } // worse case is when we have all the max-candidate slots filled except one, and we fill that // one. - register_as_candidate { - let c in 1 .. T::MaxCandidates::get() - 1; - + #[benchmark] + fn register_as_candidate(c: Linear<1, { T::MaxCandidates::get() - 1 }>) { >::put(T::Currency::minimum_balance()); >::put(c + 1); @@ -257,17 +255,21 @@ benchmarks! { >::set_keys( RawOrigin::Signed(caller.clone()).into(), keys::(c + 1), - Vec::new() - ).unwrap(); + Vec::new(), + ) + .unwrap(); + + #[extrinsic_call] + _(RawOrigin::Signed(caller.clone())); - }: _(RawOrigin::Signed(caller.clone())) - verify { - assert_last_event::(Event::CandidateAdded{account_id: caller, deposit: bond / 2u32.into()}.into()); + assert_last_event::( + Event::CandidateAdded { account_id: caller, deposit: bond / 2u32.into() }.into(), + ); } // worse case is the last candidate leaving. - leave_intent { - let c in (min_candidates::() + 1) .. T::MaxCandidates::get(); + #[benchmark] + fn leave_intent(c: Linear<{ min_candidates::() + 1 }, { T::MaxCandidates::get() }>) { >::put(T::Currency::minimum_balance()); >::put(c); @@ -275,14 +277,17 @@ benchmarks! { register_candidates::(c); let leaving = >::get().last().unwrap().who.clone(); - whitelist!(leaving); - }: _(RawOrigin::Signed(leaving.clone())) - verify { - assert_last_event::(Event::CandidateRemoved{account_id: leaving}.into()); + v2::whitelist!(leaving); + + #[extrinsic_call] + _(RawOrigin::Signed(leaving.clone())); + + assert_last_event::(Event::CandidateRemoved { account_id: leaving }.into()); } // worse case is paying a non-existing candidate account. - note_author { + #[benchmark] + fn note_author() { >::put(T::Currency::minimum_balance()); T::Currency::make_free_balance_be( &>::account_id(), @@ -293,18 +298,22 @@ benchmarks! { frame_system::Pallet::::set_block_number(new_block); assert!(T::Currency::free_balance(&author) == 0u32.into()); - }: { - as EventHandler<_, _>>::note_author(author.clone()) - } verify { + + #[block] + { + as EventHandler<_, _>>::note_author(author.clone()) + } + assert!(T::Currency::free_balance(&author) > 0u32.into()); assert_eq!(frame_system::Pallet::::block_number(), new_block); } // worst case for new session. - new_session { - let r in 1 .. T::MaxCandidates::get(); - let c in 1 .. T::MaxCandidates::get(); - + #[benchmark] + fn new_session( + r: Linear<1, { T::MaxCandidates::get() }>, + c: Linear<1, { T::MaxCandidates::get() }>, + ) { >::put(T::Currency::minimum_balance()); >::put(c); frame_system::Pallet::::set_block_number(0u32.into()); @@ -338,9 +347,12 @@ benchmarks! { frame_system::Pallet::::set_block_number(new_block); assert!(>::get().len() == c as usize); - }: { - as SessionManager<_>>::new_session(0) - } verify { + + #[block] + { + as SessionManager<_>>::new_session(0); + } + if c > r && non_removals >= min_candidates { // candidates > removals and remaining candidates > min candidates // => remaining candidates should be shorter than before removal, i.e. some were @@ -357,6 +369,6 @@ benchmarks! { assert!(>::get().len() == pre_length); } } -} -impl_benchmark_test_suite!(CollatorSelection, crate::mock::new_test_ext(), crate::mock::Test,); + impl_benchmark_test_suite!(CollatorSelection, crate::mock::new_test_ext(), crate::mock::Test,); +} From 0b9ed8e944d20c4ee32c835585e221d3f9b0d59a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jul 2023 23:14:46 +0200 Subject: [PATCH 06/17] Bump tempfile from 3.6.0 to 3.7.0 (#2912) Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.6.0 to 3.7.0. - [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md) - [Commits](https://github.com/Stebalien/tempfile/compare/v3.6.0...v3.7.0) --- updated-dependencies: - dependency-name: tempfile dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 86 +++++++++++++++++++++++------------ polkadot-parachain/Cargo.toml | 2 +- test/service/Cargo.toml | 2 +- 3 files changed, 60 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e21ac233f20..9508204efb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -935,7 +935,7 @@ version = "0.65.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cexpr", "clang-sys", "lazy_static", @@ -956,6 +956,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" + [[package]] name = "bitvec" version = "1.0.1" @@ -4114,6 +4120,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + [[package]] name = "fatality" version = "0.0.6" @@ -4438,7 +4450,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" dependencies = [ "aquamarine", - "bitflags", + "bitflags 1.3.2", "environmental", "frame-metadata", "frame-support-procedural", @@ -4656,7 +4668,7 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" dependencies = [ - "fastrand", + "fastrand 1.7.0", "futures-core", "futures-io", "memchr", @@ -5908,9 +5920,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.146" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libloading" @@ -6484,6 +6496,12 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +[[package]] +name = "linux-raw-sys" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" + [[package]] name = "lock_api" version = "0.4.6" @@ -6979,7 +6997,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" dependencies = [ "anyhow", - "bitflags", + "bitflags 1.3.2", "byteorder", "libc", "netlink-packet-core", @@ -7032,7 +7050,7 @@ version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", "memoffset 0.6.5", @@ -7044,7 +7062,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", "memoffset 0.7.1", @@ -7692,7 +7710,7 @@ name = "pallet-contracts" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" dependencies = [ - "bitflags", + "bitflags 1.3.2", "environmental", "frame-benchmarking", "frame-support", @@ -7721,7 +7739,7 @@ name = "pallet-contracts-primitives" version = "24.0.0" source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" dependencies = [ - "bitflags", + "bitflags 1.3.2", "parity-scale-codec", "scale-info", "sp-runtime", @@ -10362,7 +10380,7 @@ name = "polkadot-runtime-parachains" version = "0.9.43" source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bitvec", "derive_more", "frame-benchmarking", @@ -11225,7 +11243,7 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -11234,7 +11252,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -11634,7 +11652,7 @@ version = "0.35.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno 0.2.8", "io-lifetimes 0.7.5", "libc", @@ -11648,7 +11666,7 @@ version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno 0.2.8", "io-lifetimes 1.0.11", "libc", @@ -11662,7 +11680,7 @@ version = "0.37.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno 0.3.1", "io-lifetimes 1.0.11", "libc", @@ -11670,6 +11688,19 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "rustix" +version = "0.38.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +dependencies = [ + "bitflags 2.3.3", + "errno 0.3.1", + "libc", + "linux-raw-sys 0.4.3", + "windows-sys 0.48.0", +] + [[package]] name = "rustls" version = "0.19.1" @@ -12396,7 +12427,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" dependencies = [ "async-trait", - "bitflags", + "bitflags 1.3.2", "futures", "libp2p-identity", "parity-scale-codec", @@ -13045,7 +13076,7 @@ version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525bc1abfda2e1998d152c45cf13e696f76d0a4972310b22fac1658b05df7c87" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -13628,7 +13659,7 @@ version = "21.0.0" source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" dependencies = [ "array-bytes", - "bitflags", + "bitflags 1.3.2", "blake2", "bounded-collections", "bs58", @@ -14224,7 +14255,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg_aliases", "libc", "parking_lot 0.11.2", @@ -14505,7 +14536,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "system-configuration-sys", ] @@ -14534,15 +14565,14 @@ checksum = "9410d0f6853b1d94f0e519fb95df60f29d2c1eff2d921ffdf01a4c8a3b54f12d" [[package]] name = "tempfile" -version = "3.6.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" dependencies = [ - "autocfg", "cfg-if", - "fastrand", + "fastrand 2.0.0", "redox_syscall 0.3.5", - "rustix 0.37.19", + "rustix 0.38.4", "windows-sys 0.48.0", ] @@ -14895,7 +14925,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d1d42a9b3f3ec46ba828e8d376aec14592ea199f70a06a548587ecd1c4ab658" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bytes", "futures-core", "futures-util", @@ -16008,7 +16038,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" dependencies = [ "async-trait", - "bitflags", + "bitflags 1.3.2", "bytes", "cc", "ipnet", diff --git a/polkadot-parachain/Cargo.toml b/polkadot-parachain/Cargo.toml index 742bc61c7f4..81e8f93c9b2 100644 --- a/polkadot-parachain/Cargo.toml +++ b/polkadot-parachain/Cargo.toml @@ -97,7 +97,7 @@ substrate-build-script-utils = { git = "https://github.com/paritytech/substrate" [dev-dependencies] assert_cmd = "2.0" nix = { version = "0.26.1", features = ["signal"] } -tempfile = "3.6.0" +tempfile = "3.7.0" tokio = { version = "1.29.1", features = ["macros", "time", "parking_lot"] } wait-timeout = "0.2" diff --git a/test/service/Cargo.toml b/test/service/Cargo.toml index 958d44b59a9..0a0cca1e686 100644 --- a/test/service/Cargo.toml +++ b/test/service/Cargo.toml @@ -19,7 +19,7 @@ serde = { version = "1.0.171", features = ["derive"] } tokio = { version = "1.29.1", features = ["macros"] } tracing = "0.1.37" url = "2.4.0" -tempfile = "3.6.0" +tempfile = "3.7.0" # Substrate frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" } From 45b9ba382db26635f12e45b7477bb9c419994197 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Jul 2023 09:57:00 +0200 Subject: [PATCH 07/17] Bump parity-scale-codec from 3.6.3 to 3.6.4 (#2909) Bumps [parity-scale-codec](https://github.com/paritytech/parity-scale-codec) from 3.6.3 to 3.6.4. - [Release notes](https://github.com/paritytech/parity-scale-codec/releases) - [Changelog](https://github.com/paritytech/parity-scale-codec/blob/master/CHANGELOG.md) - [Commits](https://github.com/paritytech/parity-scale-codec/compare/v3.6.3...parity-scale-codec-v3.6.4) --- updated-dependencies: - dependency-name: parity-scale-codec dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- client/relay-chain-interface/Cargo.toml | 2 +- client/relay-chain-rpc-interface/Cargo.toml | 2 +- pallets/session-benchmarking/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9508204efb5..51bb9225d3d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8893,9 +8893,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.3" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "756d439303e94fae44f288ba881ad29670c65b0c4b0e05674ca81061bb65f2c5" +checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" dependencies = [ "arrayvec 0.7.2", "bitvec", @@ -8908,9 +8908,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.3" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d884d78fcf214d70b1e239fcd1c6e5e95aa3be1881918da2e488cc946c7a476" +checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" dependencies = [ "proc-macro-crate", "proc-macro2", diff --git a/client/relay-chain-interface/Cargo.toml b/client/relay-chain-interface/Cargo.toml index f0799b51d5c..1facab311fc 100644 --- a/client/relay-chain-interface/Cargo.toml +++ b/client/relay-chain-interface/Cargo.toml @@ -18,4 +18,4 @@ futures = "0.3.28" async-trait = "0.1.71" thiserror = "1.0.43" jsonrpsee-core = "0.16.2" -parity-scale-codec = "3.6.3" +parity-scale-codec = "3.6.4" diff --git a/client/relay-chain-rpc-interface/Cargo.toml b/client/relay-chain-rpc-interface/Cargo.toml index 3d7a9a56f6f..aaf6f08b549 100644 --- a/client/relay-chain-rpc-interface/Cargo.toml +++ b/client/relay-chain-rpc-interface/Cargo.toml @@ -25,7 +25,7 @@ tokio = { version = "1.29.1", features = ["sync"] } futures = "0.3.28" futures-timer = "3.0.2" -parity-scale-codec = "3.6.3" +parity-scale-codec = "3.6.4" jsonrpsee = { version = "0.16.2", features = ["ws-client"] } tracing = "0.1.37" async-trait = "0.1.71" diff --git a/pallets/session-benchmarking/Cargo.toml b/pallets/session-benchmarking/Cargo.toml index 8615edd0a07..ec83adbfc1d 100644 --- a/pallets/session-benchmarking/Cargo.toml +++ b/pallets/session-benchmarking/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -parity-scale-codec = { version = "3.6.3", default-features = false } +parity-scale-codec = { version = "3.6.4", default-features = false } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } From 66db07be7b3a0df7c8bc1f65a7b98e38bc6b92f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Jul 2023 14:42:56 +0200 Subject: [PATCH 08/17] Bump clap from 4.3.16 to 4.3.17 (#2908) Bumps [clap](https://github.com/clap-rs/clap) from 4.3.16 to 4.3.17. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.3.16...v4.3.17) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- client/cli/Cargo.toml | 2 +- parachain-template/node/Cargo.toml | 2 +- polkadot-parachain/Cargo.toml | 2 +- test/service/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 51bb9225d3d..521183e609a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1909,9 +1909,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.16" +version = "4.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74bb1b4028935821b2d6b439bba2e970bdcf740832732437ead910c632e30d7d" +checksum = "5b0827b011f6f8ab38590295339817b0d26f344aa4932c3ced71b45b0c54b4a9" dependencies = [ "clap_builder", "clap_derive", @@ -1920,9 +1920,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.16" +version = "4.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ae467cbb0111869b765e13882a1dbbd6cb52f58203d8b80c44f667d4dd19843" +checksum = "9441b403be87be858db6a23edb493e7f694761acdc3343d5a0fcaafd304cbc9e" dependencies = [ "anstream", "anstyle 1.0.0", diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index f4a8c14ec74..10698df1bb3 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] edition = "2021" [dependencies] -clap = { version = "4.3.16", features = ["derive"] } +clap = { version = "4.3.17", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } url = "2.4.0" diff --git a/parachain-template/node/Cargo.toml b/parachain-template/node/Cargo.toml index 790872d270c..298f6e1a936 100644 --- a/parachain-template/node/Cargo.toml +++ b/parachain-template/node/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" build = "build.rs" [dependencies] -clap = { version = "4.3.16", features = ["derive"] } +clap = { version = "4.3.17", features = ["derive"] } log = "0.4.19" codec = { package = "parity-scale-codec", version = "3.0.0" } serde = { version = "1.0.171", features = ["derive"] } diff --git a/polkadot-parachain/Cargo.toml b/polkadot-parachain/Cargo.toml index 81e8f93c9b2..a1abaa32101 100644 --- a/polkadot-parachain/Cargo.toml +++ b/polkadot-parachain/Cargo.toml @@ -12,7 +12,7 @@ path = "src/main.rs" [dependencies] async-trait = "0.1.71" -clap = { version = "4.3.16", features = ["derive"] } +clap = { version = "4.3.17", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } futures = "0.3.28" hex-literal = "0.4.1" diff --git a/test/service/Cargo.toml b/test/service/Cargo.toml index 0a0cca1e686..0c46a915737 100644 --- a/test/service/Cargo.toml +++ b/test/service/Cargo.toml @@ -10,7 +10,7 @@ path = "src/main.rs" [dependencies] async-trait = "0.1.71" -clap = { version = "4.3.16", features = ["derive"] } +clap = { version = "4.3.17", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } criterion = { version = "0.5.1", features = [ "async_tokio" ] } jsonrpsee = { version = "0.16.2", features = ["server"] } From 1ac85eda20275b58d137fed4ec01d677f114b33a Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Fri, 21 Jul 2023 23:53:51 +0200 Subject: [PATCH 09/17] Asset conversion nits (#2860) * [asset-conv] Unused Balances type * [asset-conv] native asset change * Dedicated `AssetBalance` type for `pallet_assets` instances * Improved local vs foreign asset handling + test for not allowing pool_assets in pool * Removed `into_multiasset_id` * Fix * Refactor * Fixed create_pool for benchmark with LocalAndForeignAssets (finally found it) * ".git/.scripts/commands/fmt/fmt.sh" * Revert * fmt * Migrates pools with `MultiLocation { parents: 0, interior: Here }` to `MultiLocation { parents: 1, interior: Here }` * Allow `set_storage` for `AllowMultiAssetPools` / `LiquidityWithdrawalFee` * Benchmarks work * Removed comment + more defensive migration * `T::Currency::transfer` -> `Balances::transfer_all` in migration * Change pool_id in migration * Update parachains/runtimes/assets/asset-hub-westend/src/lib.rs * Bump substrate (manually) * Bump polkadot * Fixes from polkadot + clippy * Fix for xcm-emulator tests (thank you Nacho) --------- Co-authored-by: command-bot <> Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com> --- Cargo.lock | 529 +++++++++--------- .../src/tests/reserve_transfer.rs | 2 +- .../src/tests/reserve_transfer.rs | 2 +- .../assets/asset-hub-westend/Cargo.toml | 1 + .../src/tests/reserve_transfer.rs | 2 +- .../asset-hub-westend/src/tests/swap.rs | 42 +- .../emulated/common/src/lib.rs | 1 + .../assets/asset-hub-kusama/src/lib.rs | 3 +- .../assets/asset-hub-polkadot/src/lib.rs | 2 + .../assets/asset-hub-westend/src/lib.rs | 150 ++++- .../asset-hub-westend/src/weights/mod.rs | 1 + .../src/weights/pallet_asset_conversion.rs | 157 ++++++ .../asset-hub-westend/src/xcm_config.rs | 45 +- .../assets/asset-hub-westend/tests/tests.rs | 44 +- parachains/runtimes/assets/common/Cargo.toml | 1 + .../assets/common/src/fungible_conversion.rs | 45 ++ .../common/src/local_and_foreign_assets.rs | 330 ++++++----- .../assets/test-utils/src/test_cases.rs | 3 + .../bridge-hubs/bridge-hub-kusama/src/lib.rs | 2 + .../bridge-hub-polkadot/src/lib.rs | 2 + .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 2 + .../bridge-hubs/test-utils/src/test_cases.rs | 73 +-- parachains/runtimes/test-utils/src/lib.rs | 2 + .../runtimes/test-utils/src/test_cases.rs | 91 +++ xcm/xcm-emulator/src/lib.rs | 4 +- 25 files changed, 1055 insertions(+), 481 deletions(-) create mode 100644 parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_asset_conversion.rs create mode 100644 parachains/runtimes/test-utils/src/test_cases.rs diff --git a/Cargo.lock b/Cargo.lock index 521183e609a..bb8fdf1c72c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -603,6 +603,7 @@ dependencies = [ name = "asset-hub-westend-integration-tests" version = "1.0.0" dependencies = [ + "assert_matches", "asset-hub-westend-runtime", "frame-support", "frame-system", @@ -738,6 +739,7 @@ version = "0.1.0" dependencies = [ "cumulus-primitives-core", "frame-support", + "impl-trait-for-tuples", "log", "pallet-asset-conversion", "pallet-asset-tx-payment", @@ -914,7 +916,7 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "hash-db", "log", @@ -4273,7 +4275,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "parity-scale-codec", ] @@ -4296,7 +4298,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support", "frame-support-procedural", @@ -4321,7 +4323,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "Inflector", "array-bytes", @@ -4369,7 +4371,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -4380,7 +4382,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -4397,7 +4399,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support", "frame-system", @@ -4426,7 +4428,7 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-recursion", "futures", @@ -4447,7 +4449,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "aquamarine", "bitflags 1.3.2", @@ -4482,7 +4484,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "Inflector", "cfg-expr", @@ -4500,7 +4502,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -4512,7 +4514,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "proc-macro2", "quote", @@ -4522,7 +4524,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "cfg-if", "frame-support", @@ -4541,7 +4543,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -4556,7 +4558,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "parity-scale-codec", "sp-api", @@ -4565,7 +4567,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support", "parity-scale-codec", @@ -5751,7 +5753,7 @@ checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" [[package]] name = "kusama-runtime" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bitvec", "frame-benchmarking", @@ -5851,7 +5853,7 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "frame-support", "polkadot-primitives", @@ -6796,7 +6798,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "futures", "log", @@ -6815,7 +6817,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "anyhow", "jsonrpsee", @@ -7306,7 +7308,7 @@ dependencies = [ [[package]] name = "pallet-alliance" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "array-bytes", "frame-benchmarking", @@ -7327,7 +7329,7 @@ dependencies = [ [[package]] name = "pallet-asset-conversion" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7345,7 +7347,7 @@ dependencies = [ [[package]] name = "pallet-asset-conversion-tx-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support", "frame-system", @@ -7360,7 +7362,7 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7378,7 +7380,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7393,7 +7395,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support", "frame-system", @@ -7409,7 +7411,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support", "frame-system", @@ -7425,7 +7427,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support", "frame-system", @@ -7439,7 +7441,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7463,7 +7465,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7483,7 +7485,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7498,7 +7500,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support", "frame-system", @@ -7517,7 +7519,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "array-bytes", "binary-merkle-tree", @@ -7541,7 +7543,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7647,7 +7649,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7691,7 +7693,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7708,7 +7710,7 @@ dependencies = [ [[package]] name = "pallet-contracts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "bitflags 1.3.2", "environmental", @@ -7737,7 +7739,7 @@ dependencies = [ [[package]] name = "pallet-contracts-primitives" version = "24.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -7750,7 +7752,7 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "proc-macro2", "quote", @@ -7760,7 +7762,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7777,7 +7779,7 @@ dependencies = [ [[package]] name = "pallet-core-fellowship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7795,7 +7797,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7813,7 +7815,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7836,7 +7838,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7849,7 +7851,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7868,7 +7870,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "docify", "frame-benchmarking", @@ -7887,7 +7889,7 @@ dependencies = [ [[package]] name = "pallet-glutton" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "blake2", "frame-benchmarking", @@ -7905,7 +7907,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7928,7 +7930,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7944,7 +7946,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7964,7 +7966,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7981,7 +7983,7 @@ dependencies = [ [[package]] name = "pallet-insecure-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support", "frame-system", @@ -7995,7 +7997,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8012,7 +8014,7 @@ dependencies = [ [[package]] name = "pallet-message-queue" version = "7.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8031,7 +8033,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8048,7 +8050,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8064,7 +8066,7 @@ dependencies = [ [[package]] name = "pallet-nft-fractionalization" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8081,7 +8083,7 @@ dependencies = [ [[package]] name = "pallet-nfts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "enumflags2", "frame-benchmarking", @@ -8099,7 +8101,7 @@ dependencies = [ [[package]] name = "pallet-nfts-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support", "pallet-nfts", @@ -8110,7 +8112,7 @@ dependencies = [ [[package]] name = "pallet-nis" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8126,7 +8128,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support", "frame-system", @@ -8143,7 +8145,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8163,7 +8165,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -8174,7 +8176,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support", "frame-system", @@ -8191,7 +8193,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8230,7 +8232,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8247,7 +8249,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8262,7 +8264,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8280,7 +8282,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8295,7 +8297,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "assert_matches", "frame-benchmarking", @@ -8314,7 +8316,7 @@ dependencies = [ [[package]] name = "pallet-salary" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8332,7 +8334,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8349,7 +8351,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support", "frame-system", @@ -8370,7 +8372,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8386,7 +8388,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8405,7 +8407,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8428,7 +8430,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8439,7 +8441,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "log", "sp-arithmetic", @@ -8448,7 +8450,7 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "parity-scale-codec", "sp-api", @@ -8457,7 +8459,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8474,7 +8476,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8489,7 +8491,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8507,7 +8509,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8526,7 +8528,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-support", "frame-system", @@ -8542,7 +8544,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -8558,7 +8560,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -8570,7 +8572,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8587,7 +8589,7 @@ dependencies = [ [[package]] name = "pallet-uniques" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8602,7 +8604,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8618,7 +8620,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8633,7 +8635,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8648,7 +8650,7 @@ dependencies = [ [[package]] name = "pallet-xcm" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -8669,7 +8671,7 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "frame-benchmarking", "frame-support", @@ -9286,7 +9288,7 @@ dependencies = [ [[package]] name = "polkadot-approval-distribution" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "futures", "futures-timer", @@ -9304,7 +9306,7 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "futures", "futures-timer", @@ -9319,7 +9321,7 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "derive_more", "fatality", @@ -9342,7 +9344,7 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "fatality", "futures", @@ -9363,7 +9365,7 @@ dependencies = [ [[package]] name = "polkadot-cli" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "clap", "frame-benchmarking-cli", @@ -9392,7 +9394,7 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "always-assert", "bitvec", @@ -9414,7 +9416,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "parity-scale-codec", "scale-info", @@ -9426,7 +9428,7 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "derive_more", "fatality", @@ -9451,7 +9453,7 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -9465,7 +9467,7 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "futures", "futures-timer", @@ -9485,7 +9487,7 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "always-assert", "async-trait", @@ -9508,7 +9510,7 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "futures", "parity-scale-codec", @@ -9526,7 +9528,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bitvec", "derive_more", @@ -9555,7 +9557,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bitvec", "futures", @@ -9577,7 +9579,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bitvec", "fatality", @@ -9596,7 +9598,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "futures", "polkadot-node-subsystem", @@ -9611,7 +9613,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "async-trait", "futures", @@ -9631,7 +9633,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "futures", "polkadot-node-metrics", @@ -9646,7 +9648,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "futures", "futures-timer", @@ -9663,7 +9665,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "fatality", "futures", @@ -9682,7 +9684,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "async-trait", "futures", @@ -9699,7 +9701,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bitvec", "fatality", @@ -9717,7 +9719,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "always-assert", "futures", @@ -9748,7 +9750,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "futures", "polkadot-node-primitives", @@ -9764,7 +9766,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-common" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "cpu-time", "futures", @@ -9788,7 +9790,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-execute-worker" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "cpu-time", "futures", @@ -9808,7 +9810,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-prepare-worker" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "futures", "libc", @@ -9831,7 +9833,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "futures", "lru 0.9.0", @@ -9846,7 +9848,7 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "lazy_static", "log", @@ -9864,7 +9866,7 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bs58", "futures", @@ -9883,7 +9885,7 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "async-channel", "async-trait", @@ -9906,7 +9908,7 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bounded-vec", "futures", @@ -9928,7 +9930,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -9938,7 +9940,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-test-helpers" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "async-trait", "futures", @@ -9956,7 +9958,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "async-trait", "derive_more", @@ -9980,7 +9982,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "async-trait", "derive_more", @@ -10013,7 +10015,7 @@ dependencies = [ [[package]] name = "polkadot-overseer" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "async-trait", "futures", @@ -10036,7 +10038,7 @@ dependencies = [ [[package]] name = "polkadot-parachain" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bounded-collections", "derive_more", @@ -10135,7 +10137,7 @@ dependencies = [ [[package]] name = "polkadot-performance-test" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "env_logger 0.9.0", "kusama-runtime", @@ -10153,7 +10155,7 @@ dependencies = [ [[package]] name = "polkadot-primitives" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bitvec", "hex-literal 0.4.1", @@ -10179,7 +10181,7 @@ dependencies = [ [[package]] name = "polkadot-rpc" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -10211,7 +10213,7 @@ dependencies = [ [[package]] name = "polkadot-runtime" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bitvec", "frame-benchmarking", @@ -10268,6 +10270,7 @@ dependencies = [ "pallet-vesting", "pallet-whitelist", "pallet-xcm", + "pallet-xcm-benchmarks", "parity-scale-codec", "polkadot-primitives", "polkadot-runtime-common", @@ -10306,7 +10309,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bitvec", "frame-benchmarking", @@ -10352,7 +10355,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "frame-support", "polkadot-primitives", @@ -10366,7 +10369,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bs58", "parity-scale-codec", @@ -10378,7 +10381,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -10423,7 +10426,7 @@ dependencies = [ [[package]] name = "polkadot-service" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "async-trait", "frame-benchmarking", @@ -10541,7 +10544,7 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -10563,7 +10566,7 @@ dependencies = [ [[package]] name = "polkadot-statement-table" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -10573,7 +10576,7 @@ dependencies = [ [[package]] name = "polkadot-test-client" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "frame-benchmarking", "parity-scale-codec", @@ -10601,7 +10604,7 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bitvec", "frame-election-provider-support", @@ -10662,7 +10665,7 @@ dependencies = [ [[package]] name = "polkadot-test-service" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "frame-system", "futures", @@ -11453,7 +11456,7 @@ dependencies = [ [[package]] name = "rococo-runtime" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "binary-merkle-tree", "frame-benchmarking", @@ -11540,7 +11543,7 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "frame-support", "polkadot-primitives", @@ -11822,7 +11825,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "log", "sp-core", @@ -11833,7 +11836,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "futures", @@ -11861,7 +11864,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "futures", "futures-timer", @@ -11884,7 +11887,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -11899,7 +11902,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -11918,7 +11921,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11929,7 +11932,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "array-bytes", "chrono", @@ -11968,7 +11971,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "fnv", "futures", @@ -11994,7 +11997,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "hash-db", "kvdb", @@ -12020,7 +12023,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "futures", @@ -12045,7 +12048,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "futures", @@ -12074,7 +12077,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "fork-tree", @@ -12110,7 +12113,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "futures", "jsonrpsee", @@ -12132,7 +12135,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "array-bytes", "async-channel", @@ -12166,7 +12169,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "futures", "jsonrpsee", @@ -12185,7 +12188,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "fork-tree", "parity-scale-codec", @@ -12198,7 +12201,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "ahash 0.8.2", "array-bytes", @@ -12239,7 +12242,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "finality-grandpa", "futures", @@ -12259,7 +12262,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "futures", @@ -12282,7 +12285,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", @@ -12304,7 +12307,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -12316,7 +12319,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "anyhow", "cfg-if", @@ -12333,7 +12336,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "ansi_term", "futures", @@ -12349,7 +12352,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "array-bytes", "parking_lot 0.12.1", @@ -12363,7 +12366,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "array-bytes", "async-channel", @@ -12404,7 +12407,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-channel", "cid", @@ -12424,7 +12427,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -12441,7 +12444,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "ahash 0.8.2", "futures", @@ -12459,7 +12462,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "array-bytes", "async-channel", @@ -12480,7 +12483,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "array-bytes", "async-channel", @@ -12514,7 +12517,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "array-bytes", "futures", @@ -12532,7 +12535,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "array-bytes", "bytes", @@ -12566,7 +12569,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -12575,7 +12578,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "futures", "jsonrpsee", @@ -12606,7 +12609,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12625,7 +12628,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "http", "jsonrpsee", @@ -12640,7 +12643,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "array-bytes", "futures", @@ -12666,7 +12669,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "directories", @@ -12730,7 +12733,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "log", "parity-scale-codec", @@ -12741,7 +12744,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "clap", "fs4", @@ -12755,7 +12758,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12774,7 +12777,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "futures", "libc", @@ -12793,7 +12796,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "chrono", "futures", @@ -12812,7 +12815,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "ansi_term", "atty", @@ -12841,7 +12844,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -12852,7 +12855,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "futures", @@ -12878,7 +12881,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "futures", @@ -12894,7 +12897,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-channel", "futures", @@ -13375,7 +13378,7 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "enumn", "parity-scale-codec", @@ -13452,7 +13455,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "hash-db", "log", @@ -13473,7 +13476,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "Inflector", "blake2", @@ -13487,7 +13490,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "23.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "parity-scale-codec", "scale-info", @@ -13500,7 +13503,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "16.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "integer-sqrt", "num-traits", @@ -13514,7 +13517,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "parity-scale-codec", "scale-info", @@ -13527,7 +13530,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "sp-api", "sp-inherents", @@ -13538,7 +13541,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "futures", "log", @@ -13556,7 +13559,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "futures", @@ -13571,7 +13574,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "parity-scale-codec", @@ -13588,7 +13591,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "parity-scale-codec", @@ -13607,7 +13610,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "lazy_static", "parity-scale-codec", @@ -13626,7 +13629,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "finality-grandpa", "log", @@ -13644,7 +13647,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "parity-scale-codec", "scale-info", @@ -13656,7 +13659,7 @@ dependencies = [ [[package]] name = "sp-core" version = "21.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "array-bytes", "bitflags 1.3.2", @@ -13701,7 +13704,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "9.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "blake2b_simd", "byteorder", @@ -13714,7 +13717,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "9.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "quote", "sp-core-hashing", @@ -13724,7 +13727,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -13733,7 +13736,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "proc-macro2", "quote", @@ -13743,7 +13746,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.19.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "environmental", "parity-scale-codec", @@ -13754,7 +13757,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -13768,7 +13771,7 @@ dependencies = [ [[package]] name = "sp-io" version = "23.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "bytes", "ed25519", @@ -13793,7 +13796,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "24.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "lazy_static", "sp-core", @@ -13804,7 +13807,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.27.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", @@ -13816,7 +13819,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "thiserror", "zstd 0.12.3+zstd.1.5.2", @@ -13825,7 +13828,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -13836,7 +13839,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -13854,7 +13857,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "parity-scale-codec", "scale-info", @@ -13868,7 +13871,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "sp-api", "sp-core", @@ -13878,7 +13881,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "backtrace", "lazy_static", @@ -13888,7 +13891,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "rustc-hash", "serde", @@ -13898,7 +13901,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "24.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "either", "hash256-std-hasher", @@ -13920,7 +13923,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "17.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -13938,7 +13941,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "11.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "Inflector", "proc-macro-crate", @@ -13950,7 +13953,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "parity-scale-codec", "scale-info", @@ -13965,7 +13968,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -13979,7 +13982,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.28.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "hash-db", "log", @@ -14000,7 +14003,7 @@ dependencies = [ [[package]] name = "sp-statement-store" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "aes-gcm 0.10.2", "curve25519-dalek 3.2.0", @@ -14024,12 +14027,12 @@ dependencies = [ [[package]] name = "sp-std" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" [[package]] name = "sp-storage" version = "13.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "impl-serde", "parity-scale-codec", @@ -14042,7 +14045,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "parity-scale-codec", @@ -14055,7 +14058,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "10.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "parity-scale-codec", "sp-std", @@ -14067,7 +14070,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "sp-api", "sp-runtime", @@ -14076,7 +14079,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "parity-scale-codec", @@ -14091,7 +14094,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "22.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "ahash 0.8.2", "hash-db", @@ -14114,7 +14117,7 @@ dependencies = [ [[package]] name = "sp-version" version = "22.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "impl-serde", "parity-scale-codec", @@ -14131,7 +14134,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -14142,7 +14145,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "14.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -14155,7 +14158,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "20.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "parity-scale-codec", "scale-info", @@ -14353,12 +14356,12 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -14377,7 +14380,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "hyper", "log", @@ -14389,7 +14392,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "jsonrpsee", @@ -14402,7 +14405,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -14419,7 +14422,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "array-bytes", "async-trait", @@ -14445,7 +14448,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "futures", "substrate-test-utils-derive", @@ -14455,7 +14458,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -14466,7 +14469,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "ansi_term", "build-helper", @@ -14594,7 +14597,7 @@ checksum = "13a4ec180a2de59b57434704ccfad967f789b12737738798fa08798cd5824c16" [[package]] name = "test-runtime-constants" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "frame-support", "polkadot-primitives", @@ -14996,7 +14999,7 @@ dependencies = [ [[package]] name = "tracing-gum" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "coarsetime", "polkadot-node-jaeger", @@ -15008,7 +15011,7 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "expander 2.0.0", "proc-macro-crate", @@ -15138,7 +15141,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#696d09b3d1da1b2045fe46200df1d9f6d6d9d829" +source = "git+https://github.com/paritytech/substrate?branch=master#e076bdad1fefb5a0e2461acf7e2cab1192f3c9f3" dependencies = [ "async-trait", "clap", @@ -16064,7 +16067,7 @@ dependencies = [ [[package]] name = "westend-runtime" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bitvec", "frame-benchmarking", @@ -16157,7 +16160,7 @@ dependencies = [ [[package]] name = "westend-runtime-constants" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "frame-support", "polkadot-primitives", @@ -16548,7 +16551,7 @@ dependencies = [ [[package]] name = "xcm" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "bounded-collections", "derivative", @@ -16564,7 +16567,7 @@ dependencies = [ [[package]] name = "xcm-builder" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "frame-support", "frame-system", @@ -16618,7 +16621,7 @@ dependencies = [ [[package]] name = "xcm-executor" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "environmental", "frame-benchmarking", @@ -16638,7 +16641,7 @@ dependencies = [ [[package]] name = "xcm-procedural" version = "0.9.43" -source = "git+https://github.com/paritytech/polkadot?branch=master#a4936f1b7f846558340129a05bbb2a0f6b24f085" +source = "git+https://github.com/paritytech/polkadot?branch=master#e0ed7e862c8c8b6c75eda1731c449543642176ef" dependencies = [ "Inflector", "proc-macro2", diff --git a/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs b/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs index e1107ebb565..b1c5cbbd3bf 100644 --- a/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs +++ b/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/tests/reserve_transfer.rs @@ -50,7 +50,7 @@ fn reserve_transfer_native_asset_from_relay_to_assets() { Kusama, vec![ RuntimeEvent::XcmPallet(pallet_xcm::Event::Attempted { outcome: Outcome::Complete(weight) }) => { - weight: weight_within_threshold((REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), Weight::from_parts(754_244_000, 0), *weight), + weight: weight_within_threshold((REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), Weight::from_parts(630_092_000, 6196), *weight), }, ] ); diff --git a/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs index a880bc43b2b..ffe9bac86d5 100644 --- a/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs +++ b/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/tests/reserve_transfer.rs @@ -50,7 +50,7 @@ fn reserve_transfer_native_asset_from_relay_to_assets() { Polkadot, vec![ RuntimeEvent::XcmPallet(pallet_xcm::Event::Attempted { outcome: Outcome::Complete(weight) }) => { - weight: weight_within_threshold((REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), Weight::from_parts(2_000_000_000, 0), *weight), + weight: weight_within_threshold((REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), Weight::from_parts(686_043_000, 6196), *weight), }, ] ); diff --git a/parachains/integration-tests/emulated/assets/asset-hub-westend/Cargo.toml b/parachains/integration-tests/emulated/assets/asset-hub-westend/Cargo.toml index 8d42392b4ba..8e9b1dd6603 100644 --- a/parachains/integration-tests/emulated/assets/asset-hub-westend/Cargo.toml +++ b/parachains/integration-tests/emulated/assets/asset-hub-westend/Cargo.toml @@ -7,6 +7,7 @@ description = "Asset Hub Westend runtime integration tests with xcm-emulator" [dependencies] codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } +assert_matches = "1.5.0" # Substrate sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs index 8a0191a6fe6..7ef76efdfed 100644 --- a/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs +++ b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/reserve_transfer.rs @@ -50,7 +50,7 @@ fn reserve_transfer_native_asset_from_relay_to_assets() { Westend, vec![ RuntimeEvent::XcmPallet(pallet_xcm::Event::Attempted { outcome: Outcome::Complete(weight) }) => { - weight: weight_within_threshold((REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), Weight::from_parts(731_495_000, 0), *weight), + weight: weight_within_threshold((REF_TIME_THRESHOLD, PROOF_SIZE_THRESHOLD), Weight::from_parts(629_384_000, 6196), *weight), }, ] ); diff --git a/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/swap.rs b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/swap.rs index 27d15b689bb..fabdb9349ef 100644 --- a/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/swap.rs +++ b/parachains/integration-tests/emulated/assets/asset-hub-westend/src/tests/swap.rs @@ -1,12 +1,13 @@ use crate::*; use frame_support::{instances::Instance2, BoundedVec}; +use sp_runtime::{DispatchError, ModuleError}; use xcm_emulator::Parachain; #[test] fn swap_locally_on_chain_using_local_assets() { const ASSET_ID: u32 = 1; - let asset_native = Box::new(MultiLocation { parents: 0, interior: Here }); + let asset_native = Box::new(asset_hub_westend_runtime::xcm_config::WestendLocation::get()); let asset_one = Box::new(MultiLocation { parents: 0, interior: X2(PalletInstance(50), GeneralIndex(ASSET_ID.into())), @@ -99,7 +100,7 @@ fn swap_locally_on_chain_using_foreign_assets() { use frame_support::weights::WeightToFee; const ASSET_ID: u32 = 1; - let asset_native = Box::new(MultiLocation { parents: 0, interior: Here }); + let asset_native = Box::new(asset_hub_westend_runtime::xcm_config::WestendLocation::get()); let foreign_asset1_at_asset_hub_westend = Box::new(MultiLocation { parents: 1, @@ -305,3 +306,40 @@ fn swap_locally_on_chain_using_foreign_assets() { )); }); } + +#[test] +fn cannot_create_pool_from_pool_assets() { + const ASSET_ID: u32 = 1; + + let asset_native = Box::new(asset_hub_westend_runtime::xcm_config::WestendLocation::get()); + let mut asset_one = asset_hub_westend_runtime::xcm_config::PoolAssetsPalletLocation::get(); + asset_one.append_with(GeneralIndex(ASSET_ID.into())).expect("pool assets"); + + AssetHubWestend::execute_with(|| { + let pool_owner_account_id = asset_hub_westend_runtime::AssetConversionOrigin::get(); + + assert_ok!(::PoolAssets::create( + ::RuntimeOrigin::signed(pool_owner_account_id.clone()), + ASSET_ID.into(), + pool_owner_account_id.clone().into(), + 1000, + )); + assert!(::PoolAssets::asset_exists(ASSET_ID)); + + assert_ok!(::PoolAssets::mint( + ::RuntimeOrigin::signed(pool_owner_account_id), + ASSET_ID.into(), + AssetHubWestendSender::get().into(), + 3_000_000_000_000, + )); + + assert_matches::assert_matches!( + ::AssetConversion::create_pool( + ::RuntimeOrigin::signed(AssetHubWestendSender::get()), + asset_native.clone(), + Box::new(asset_one), + ), + Err(DispatchError::Module(ModuleError{index: _, error: _, message})) => assert_eq!(message, Some("UnsupportedAsset")) + ); + }); +} diff --git a/parachains/integration-tests/emulated/common/src/lib.rs b/parachains/integration-tests/emulated/common/src/lib.rs index d88f1ddd3e3..23b05a54c72 100644 --- a/parachains/integration-tests/emulated/common/src/lib.rs +++ b/parachains/integration-tests/emulated/common/src/lib.rs @@ -289,6 +289,7 @@ decl_test_parachains! { PolkadotXcm: asset_hub_westend_runtime::PolkadotXcm, Assets: asset_hub_westend_runtime::Assets, ForeignAssets: asset_hub_westend_runtime::ForeignAssets, + PoolAssets: asset_hub_westend_runtime::PoolAssets, AssetConversion: asset_hub_westend_runtime::AssetConversion, } }, diff --git a/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs b/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs index e17ea94686f..08babe35e38 100644 --- a/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs @@ -1139,7 +1139,7 @@ impl_runtime_apis! { MultiAsset { fun: Fungible(UNITS), id: Concrete(KsmLocation::get()) }, )); pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; - + pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None; } impl pallet_xcm_benchmarks::fungible::Config for Runtime { @@ -1147,6 +1147,7 @@ impl_runtime_apis! { type CheckedAccount = CheckedAccount; type TrustedTeleporter = TrustedTeleporter; + type TrustedReserve = TrustedReserve; fn get_multi_asset() -> MultiAsset { MultiAsset { diff --git a/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs index 4f1e80cdc0d..7aee88a23a8 100644 --- a/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs @@ -1121,6 +1121,7 @@ impl_runtime_apis! { MultiAsset { fun: Fungible(UNITS), id: Concrete(DotLocation::get()) }, )); pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; + pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None; } impl pallet_xcm_benchmarks::fungible::Config for Runtime { @@ -1128,6 +1129,7 @@ impl_runtime_apis! { type CheckedAccount = CheckedAccount; type TrustedTeleporter = TrustedTeleporter; + type TrustedReserve = TrustedReserve; fn get_multi_asset() -> MultiAsset { MultiAsset { diff --git a/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index 204179f4a9d..eeefaee3826 100644 --- a/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -28,8 +28,13 @@ pub mod constants; mod weights; pub mod xcm_config; -use crate::xcm_config::{TrustBackedAssetsPalletLocation, UniversalLocation}; -use assets_common::local_and_foreign_assets::{LocalAndForeignAssets, MultiLocationConverter}; +use crate::xcm_config::{ + LocalAndForeignAssetsMultiLocationMatcher, TrustBackedAssetsPalletLocation, +}; +use assets_common::{ + local_and_foreign_assets::{LocalAndForeignAssets, MultiLocationConverter}, + AssetIdForTrustBackedAssetsConvert, +}; use codec::{Decode, Encode, MaxEncodedLen}; use constants::{currency::*, fee::WeightToFee}; use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; @@ -300,9 +305,13 @@ impl pallet_asset_conversion::Config for Runtime { type Balance = Balance; type HigherPrecisionBalance = sp_core::U256; type Currency = Balances; - type AssetBalance = ::Balance; + type AssetBalance = Balance; type AssetId = MultiLocation; - type Assets = LocalAndForeignAssets; + type Assets = LocalAndForeignAssets< + Assets, + AssetIdForTrustBackedAssetsConvert, + ForeignAssets, + >; type PoolAssets = PoolAssets; type PoolAssetId = u32; type PoolSetupFee = ConstU128<0>; // Asset class deposit fees are sufficient to prevent spam @@ -314,11 +323,12 @@ impl pallet_asset_conversion::Config for Runtime { type MaxSwapPathLength = ConstU32<4>; type MultiAssetId = Box; - type MultiAssetIdConverter = MultiLocationConverter; + type MultiAssetIdConverter = + MultiLocationConverter; type MintMinLiquidity = ConstU128<100>; - type WeightInfo = (); + type WeightInfo = weights::pallet_asset_conversion::WeightInfo; #[cfg(feature = "runtime-benchmarks")] type BenchmarkHelper = @@ -659,7 +669,11 @@ impl pallet_collator_selection::Config for Runtime { impl pallet_asset_conversion_tx_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type Fungibles = LocalAndForeignAssets; + type Fungibles = LocalAndForeignAssets< + Assets, + AssetIdForTrustBackedAssetsConvert, + ForeignAssets, + >; type OnChargeAssetTransaction = AssetConversionAdapter; } @@ -835,6 +849,8 @@ pub type Migrations = ( pallet_nfts::migration::v1::MigrateToV1, // unreleased pallet_collator_selection::migration::v1::MigrateToV1, + // unreleased + migrations::NativeAssetParents0ToParents1Migration, ); /// Executive: handles dispatch to the various modules. @@ -1240,7 +1256,7 @@ impl_runtime_apis! { MultiAsset { fun: Fungible(UNITS), id: Concrete(WestendLocation::get()) }, )); pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; - + pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None; } impl pallet_xcm_benchmarks::fungible::Config for Runtime { @@ -1248,6 +1264,7 @@ impl_runtime_apis! { type CheckedAccount = CheckedAccount; type TrustedTeleporter = TrustedTeleporter; + type TrustedReserve = TrustedReserve; fn get_multi_asset() -> MultiAsset { MultiAsset { @@ -1360,3 +1377,120 @@ cumulus_pallet_parachain_system::register_validate_block! { BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::, CheckInherents = CheckInherents, } + +pub mod migrations { + use super::*; + use frame_support::{ + pallet_prelude::Get, + traits::{ + fungibles::{Inspect, Mutate}, + tokens::Preservation, + OnRuntimeUpgrade, OriginTrait, + }, + }; + use parachains_common::impls::AccountIdOf; + use sp_runtime::{traits::StaticLookup, Saturating}; + use xcm::latest::prelude::*; + + /// Temporary migration because of bug with native asset, it can be removed once applied on `AssetHubWestend`. + /// Migrates pools with `MultiLocation { parents: 0, interior: Here }` to `MultiLocation { parents: 1, interior: Here }` + pub struct NativeAssetParents0ToParents1Migration(sp_std::marker::PhantomData); + impl< + T: pallet_asset_conversion::Config< + MultiAssetId = Box, + AssetId = MultiLocation, + >, + > OnRuntimeUpgrade for NativeAssetParents0ToParents1Migration + where + ::PoolAssetId: Into, + AccountIdOf: Into<[u8; 32]>, + ::AccountId: + Into<<::RuntimeOrigin as OriginTrait>::AccountId>, + <::Lookup as StaticLookup>::Source: + From<::AccountId>, + sp_runtime::AccountId32: From<::AccountId>, + { + fn on_runtime_upgrade() -> Weight { + let invalid_native_asset = MultiLocation { parents: 0, interior: Here }; + let valid_native_asset = WestendLocation::get(); + + let mut reads: u64 = 1; + let mut writes: u64 = 0; + + // migrate pools with invalid native asset + let pools = pallet_asset_conversion::Pools::::iter().collect::>(); + reads.saturating_accrue(1); + for (old_pool_id, pool_info) in pools { + let old_pool_account = + pallet_asset_conversion::Pallet::::get_pool_account(&old_pool_id); + reads.saturating_accrue(1); + let pool_asset_id = pool_info.lp_token.clone(); + if old_pool_id.0.as_ref() != &invalid_native_asset { + // skip, if ok + continue + } + + // fix new account + let new_pool_id = pallet_asset_conversion::Pallet::::get_pool_id( + Box::new(valid_native_asset), + old_pool_id.1.clone(), + ); + let new_pool_account = + pallet_asset_conversion::Pallet::::get_pool_account(&new_pool_id); + frame_system::Pallet::::inc_providers(&new_pool_account); + reads.saturating_accrue(2); + writes.saturating_accrue(1); + + // move currency + let _ = Balances::transfer_all( + RuntimeOrigin::signed(sp_runtime::AccountId32::from(old_pool_account.clone())), + sp_runtime::AccountId32::from(new_pool_account.clone()).into(), + false, + ); + reads.saturating_accrue(2); + writes.saturating_accrue(2); + + // move LP token + let _ = T::PoolAssets::transfer( + pool_asset_id.clone(), + &old_pool_account, + &new_pool_account, + T::PoolAssets::balance(pool_asset_id.clone(), &old_pool_account), + Preservation::Expendable, + ); + reads.saturating_accrue(1); + writes.saturating_accrue(2); + + // change the ownership of LP token + let _ = pallet_assets::Pallet::::transfer_ownership( + RuntimeOrigin::signed(sp_runtime::AccountId32::from(old_pool_account.clone())), + pool_asset_id.into(), + sp_runtime::AccountId32::from(new_pool_account.clone()).into(), + ); + reads.saturating_accrue(1); + writes.saturating_accrue(2); + + // move LocalOrForeignAssets + let _ = T::Assets::transfer( + *old_pool_id.1.as_ref(), + &old_pool_account, + &new_pool_account, + T::Assets::balance(*old_pool_id.1.as_ref(), &old_pool_account), + Preservation::Expendable, + ); + reads.saturating_accrue(1); + writes.saturating_accrue(2); + + // dec providers for old account + let _ = frame_system::Pallet::::dec_providers(&old_pool_account); + writes.saturating_accrue(1); + + // change pool key + pallet_asset_conversion::Pools::::insert(new_pool_id, pool_info); + pallet_asset_conversion::Pools::::remove(old_pool_id); + } + + T::DbWeight::get().reads_writes(reads, writes) + } + } +} diff --git a/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs index fe750e4e1ce..955d4690634 100644 --- a/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs @@ -2,6 +2,7 @@ pub mod block_weights; pub mod cumulus_pallet_xcmp_queue; pub mod extrinsic_weights; pub mod frame_system; +pub mod pallet_asset_conversion; pub mod pallet_assets_foreign; pub mod pallet_assets_local; pub mod pallet_assets_pool; diff --git a/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_asset_conversion.rs b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_asset_conversion.rs new file mode 100644 index 00000000000..6b81cfb7ff1 --- /dev/null +++ b/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_asset_conversion.rs @@ -0,0 +1,157 @@ +// Copyright 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_asset_conversion` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-07-18, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bkontur-ThinkPad-P14s-Gen-2i`, CPU: `11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz` +//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-westend-dev")`, DB CACHE: 1024 + +// Executed Command: +// ./target/release/polkadot-parachain +// benchmark +// pallet +// --chain=asset-hub-westend-dev +// --wasm-execution=compiled +// --pallet=pallet_asset_conversion +// --no-storage-info +// --no-median-slopes +// --no-min-squares +// --extrinsic=* +// --steps=2 +// --repeat=1 +// --json +// --header=./file_header.txt +// --output=./parachains/runtimes/assets/asset-hub-westend/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `pallet_asset_conversion`. +pub struct WeightInfo(PhantomData); +impl pallet_asset_conversion::WeightInfo for WeightInfo { + /// Storage: `AssetConversion::Pools` (r:1 w:1) + /// Proof: `AssetConversion::Pools` (`max_values`: None, `max_size`: Some(1224), added: 3699, mode: `MaxEncodedLen`) + /// Storage: UNKNOWN KEY `0x76a2c49709deec21d9c05f96c1f47351` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x76a2c49709deec21d9c05f96c1f47351` (r:1 w:0) + /// Storage: `System::Account` (r:2 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ForeignAssets::Account` (r:1 w:1) + /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`) + /// Storage: `ForeignAssets::Asset` (r:1 w:1) + /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`) + /// Storage: `AssetConversion::NextPoolAssetId` (r:1 w:1) + /// Proof: `AssetConversion::NextPoolAssetId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `PoolAssets::Asset` (r:1 w:1) + /// Proof: `PoolAssets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `PoolAssets::Account` (r:1 w:1) + /// Proof: `PoolAssets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + fn create_pool() -> Weight { + // Proof Size summary in bytes: + // Measured: `480` + // Estimated: `6196` + // Minimum execution time: 115_870_000 picoseconds. + Weight::from_parts(115_870_000, 0) + .saturating_add(Weight::from_parts(0, 6196)) + .saturating_add(T::DbWeight::get().reads(9)) + .saturating_add(T::DbWeight::get().writes(7)) + } + /// Storage: `AssetConversion::Pools` (r:1 w:0) + /// Proof: `AssetConversion::Pools` (`max_values`: None, `max_size`: Some(1224), added: 3699, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ForeignAssets::Asset` (r:1 w:1) + /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`) + /// Storage: `ForeignAssets::Account` (r:2 w:2) + /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`) + /// Storage: `PoolAssets::Asset` (r:1 w:1) + /// Proof: `PoolAssets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: `PoolAssets::Account` (r:2 w:2) + /// Proof: `PoolAssets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + fn add_liquidity() -> Weight { + // Proof Size summary in bytes: + // Measured: `1117` + // Estimated: `7404` + // Minimum execution time: 183_835_000 picoseconds. + Weight::from_parts(183_835_000, 0) + .saturating_add(Weight::from_parts(0, 7404)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(7)) + } + /// Storage: `AssetConversion::Pools` (r:1 w:0) + /// Proof: `AssetConversion::Pools` (`max_values`: None, `max_size`: Some(1224), added: 3699, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ForeignAssets::Asset` (r:1 w:1) + /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`) + /// Storage: `ForeignAssets::Account` (r:2 w:2) + /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`) + /// Storage: `PoolAssets::Asset` (r:1 w:1) + /// Proof: `PoolAssets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`) + /// Storage: UNKNOWN KEY `0x2433d831722b1f4aeb1666953f1c0e77` (r:1 w:0) + /// Proof: UNKNOWN KEY `0x2433d831722b1f4aeb1666953f1c0e77` (r:1 w:0) + /// Storage: `PoolAssets::Account` (r:1 w:1) + /// Proof: `PoolAssets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`) + fn remove_liquidity() -> Weight { + // Proof Size summary in bytes: + // Measured: `1106` + // Estimated: `7404` + // Minimum execution time: 166_533_000 picoseconds. + Weight::from_parts(166_533_000, 0) + .saturating_add(Weight::from_parts(0, 7404)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(6)) + } + /// Storage: `ForeignAssets::Asset` (r:2 w:2) + /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`) + /// Storage: `ForeignAssets::Account` (r:4 w:4) + /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn swap_exact_tokens_for_tokens() -> Weight { + // Proof Size summary in bytes: + // Measured: `1148` + // Estimated: `13818` + // Minimum execution time: 206_165_000 picoseconds. + Weight::from_parts(206_165_000, 0) + .saturating_add(Weight::from_parts(0, 13818)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(8)) + } + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `ForeignAssets::Asset` (r:2 w:2) + /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`) + /// Storage: `ForeignAssets::Account` (r:4 w:4) + /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`) + fn swap_tokens_for_exact_tokens() -> Weight { + // Proof Size summary in bytes: + // Measured: `1148` + // Estimated: `13818` + // Minimum execution time: 208_694_000 picoseconds. + Weight::from_parts(208_694_000, 0) + .saturating_add(Weight::from_parts(0, 13818)) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(8)) + } +} diff --git a/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs b/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs index e3615705e20..e52512acfbf 100644 --- a/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/xcm_config.rs @@ -18,9 +18,12 @@ use super::{ ParachainSystem, PolkadotXcm, PoolAssets, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, TrustBackedAssetsInstance, WeightToFee, XcmpQueue, }; -use crate::ForeignAssets; -use assets_common::matching::{ - FromSiblingParachain, IsForeignConcreteAsset, StartsWith, StartsWithExplicitGlobalConsensus, +use crate::{AllowMultiAssetPools, ForeignAssets, LiquidityWithdrawalFee}; +use assets_common::{ + local_and_foreign_assets::MatchesLocalAndForeignAssetsMultiLocation, + matching::{ + FromSiblingParachain, IsForeignConcreteAsset, StartsWith, StartsWithExplicitGlobalConsensus, + }, }; use frame_support::{ match_types, parameter_types, @@ -163,6 +166,25 @@ pub type PoolFungiblesTransactor = FungiblesAdapter< pub type AssetTransactors = (CurrencyTransactor, FungiblesTransactor, ForeignFungiblesTransactor, PoolFungiblesTransactor); +/// Simple `MultiLocation` matcher for Local and Foreign asset `MultiLocation`. +pub struct LocalAndForeignAssetsMultiLocationMatcher; +impl MatchesLocalAndForeignAssetsMultiLocation for LocalAndForeignAssetsMultiLocationMatcher { + fn is_local(location: &MultiLocation) -> bool { + use assets_common::fungible_conversion::MatchesMultiLocation; + TrustBackedAssetsConvertedConcreteId::contains(location) + } + + fn is_foreign(location: &MultiLocation) -> bool { + use assets_common::fungible_conversion::MatchesMultiLocation; + ForeignAssetsConvertedConcreteId::contains(location) + } +} +impl Contains for LocalAndForeignAssetsMultiLocationMatcher { + fn contains(location: &MultiLocation) -> bool { + Self::is_local(location) || Self::is_foreign(location) + } +} + /// 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. @@ -217,6 +239,16 @@ impl Contains for SafeCallFilter { } } + // Allow to change dedicated storage items (called by governance-like) + match call { + RuntimeCall::System(frame_system::Call::set_storage { items }) + if items.iter().any(|(k, _)| { + k.eq(&AllowMultiAssetPools::key()) | k.eq(&LiquidityWithdrawalFee::key()) + }) => + return true, + _ => (), + }; + matches!( call, RuntimeCall::PolkadotXcm(pallet_xcm::Call::force_xcm_version { .. }) | @@ -540,7 +572,8 @@ pub struct BenchmarkMultiLocationConverter { } #[cfg(feature = "runtime-benchmarks")] -impl pallet_asset_conversion::BenchmarkHelper +impl + pallet_asset_conversion::BenchmarkHelper> for BenchmarkMultiLocationConverter where SelfParaId: Get, @@ -555,4 +588,8 @@ where ), } } + + fn multiasset_id(asset_id: u32) -> sp_std::boxed::Box { + sp_std::boxed::Box::new(Self::asset_id(asset_id)) + } } diff --git a/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs b/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs index 4cfed8fed08..0114c6d8174 100644 --- a/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs +++ b/parachains/runtimes/assets/asset-hub-westend/tests/tests.rs @@ -28,7 +28,8 @@ use asset_hub_westend_runtime::{ AssetFeeAsExistentialDepositMultiplierFeeCharger, ForeignCreatorsSovereignAccountOf, WestendLocation, }, - MetadataDepositBase, MetadataDepositPerByte, RuntimeCall, RuntimeEvent, + AllowMultiAssetPools, LiquidityWithdrawalFee, MetadataDepositBase, MetadataDepositPerByte, + RuntimeCall, RuntimeEvent, }; use asset_test_utils::{CollatorSessionKeys, ExtBuilder, RuntimeHelper, XcmReceivedFrom}; use codec::{Decode, DecodeLimit, Encode}; @@ -39,7 +40,10 @@ use frame_support::{ weights::{Weight, WeightToFee as WeightToFeeT}, }; use parachains_common::{AccountId, AssetIdForTrustBackedAssets, AuraId, Balance}; -use sp_runtime::traits::MaybeEquivalence; +use sp_runtime::{ + traits::{CheckedAdd, CheckedSub, MaybeEquivalence}, + Permill, +}; use std::convert::Into; use xcm::{latest::prelude::*, VersionedXcm, MAX_XCM_DECODE_DEPTH}; use xcm_executor::{ @@ -652,3 +656,39 @@ fn plain_receive_teleported_asset_works() { assert_eq!(outcome.ensure_complete(), Ok(())); }) } + +#[test] +fn change_allow_multi_asset_pools_by_governance_works() { + asset_test_utils::test_cases::change_storage_constant_by_governance_works::< + Runtime, + AllowMultiAssetPools, + bool, + >( + collator_session_keys(), + 1000, + Box::new(|call| RuntimeCall::System(call).encode()), + || (AllowMultiAssetPools::key().to_vec(), AllowMultiAssetPools::get()), + |old_value| !old_value, + ) +} + +#[test] +fn change_liquidity_withdrawal_fee_by_governance_works() { + asset_test_utils::test_cases::change_storage_constant_by_governance_works::< + Runtime, + LiquidityWithdrawalFee, + Permill, + >( + collator_session_keys(), + 1000, + Box::new(|call| RuntimeCall::System(call).encode()), + || (LiquidityWithdrawalFee::key().to_vec(), LiquidityWithdrawalFee::get()), + |old_value| { + if let Some(new_value) = old_value.checked_add(&Permill::from_percent(2)) { + new_value + } else { + old_value.checked_sub(&Permill::from_percent(2)).unwrap() + } + }, + ) +} diff --git a/parachains/runtimes/assets/common/Cargo.toml b/parachains/runtimes/assets/common/Cargo.toml index 79937ec4363..f7460aa709b 100644 --- a/parachains/runtimes/assets/common/Cargo.toml +++ b/parachains/runtimes/assets/common/Cargo.toml @@ -9,6 +9,7 @@ description = "Assets common utilities" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } log = { version = "0.4.19", default-features = false } +impl-trait-for-tuples = "0.2.2" # Substrate frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } diff --git a/parachains/runtimes/assets/common/src/fungible_conversion.rs b/parachains/runtimes/assets/common/src/fungible_conversion.rs index 00f0c40d611..5aa5a69caa9 100644 --- a/parachains/runtimes/assets/common/src/fungible_conversion.rs +++ b/parachains/runtimes/assets/common/src/fungible_conversion.rs @@ -37,6 +37,19 @@ where ) -> Result; } +/// Checks for `MultiLocation`. +pub trait MatchesMultiLocation: + MatchesFungibles +where + AssetId: Clone, + Balance: Clone, + MatchAssetId: Contains, + ConvertAssetId: MaybeEquivalence, + ConvertBalance: MaybeEquivalence, +{ + fn contains(location: &MultiLocation) -> bool; +} + impl< AssetId: Clone, Balance: Clone, @@ -82,6 +95,38 @@ impl< } } +impl< + AssetId: Clone, + Balance: Clone, + MatchAssetId: Contains, + ConvertAssetId: MaybeEquivalence, + ConvertBalance: MaybeEquivalence, + > MatchesMultiLocation + for MatchedConvertedConcreteId +{ + fn contains(location: &MultiLocation) -> bool { + MatchAssetId::contains(location) + } +} + +#[impl_trait_for_tuples::impl_for_tuples(30)] +impl< + AssetId: Clone, + Balance: Clone, + MatchAssetId: Contains, + ConvertAssetId: MaybeEquivalence, + ConvertBalance: MaybeEquivalence, + > MatchesMultiLocation for Tuple +{ + fn contains(location: &MultiLocation) -> bool { + for_tuples!( #( + match Tuple::contains(location) { o @ true => return o, _ => () } + )* ); + log::trace!(target: "xcm::contains", "did not match location: {:?}", &location); + false + } +} + /// Helper function to convert collections with [`(AssetId, Balance)`] to [`MultiAsset`] pub fn convert<'a, AssetId, Balance, ConvertAssetId, ConvertBalance, Converter>( items: impl Iterator, diff --git a/parachains/runtimes/assets/common/src/local_and_foreign_assets.rs b/parachains/runtimes/assets/common/src/local_and_foreign_assets.rs index f50cf1331a0..72fd9e7a916 100644 --- a/parachains/runtimes/assets/common/src/local_and_foreign_assets.rs +++ b/parachains/runtimes/assets/common/src/local_and_foreign_assets.rs @@ -13,92 +13,81 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate::local_and_foreign_assets::fungibles::Inspect; -use cumulus_primitives_core::InteriorMultiLocation; use frame_support::{ pallet_prelude::DispatchError, traits::{ - fungibles::{ - self, Balanced, Create, HandleImbalanceDrop, Mutate as MutateFungible, Unbalanced, + fungibles::{Balanced, Create, HandleImbalanceDrop, Inspect, Mutate, Unbalanced}, + tokens::{ + DepositConsequence, Fortitude, Precision, Preservation, Provenance, WithdrawConsequence, }, - tokens::{DepositConsequence, Fortitude, Preservation, Provenance, WithdrawConsequence}, - AccountTouch, ContainsPair, Get, PalletInfoAccess, + AccountTouch, Contains, ContainsPair, Get, PalletInfoAccess, }, }; -use pallet_asset_conversion::MultiAssetIdConverter; -use parachains_common::{AccountId, AssetIdForTrustBackedAssets}; +use pallet_asset_conversion::{MultiAssetIdConversionResult, MultiAssetIdConverter}; +use parachains_common::AccountId; use sp_runtime::{traits::MaybeEquivalence, DispatchResult}; use sp_std::{boxed::Box, marker::PhantomData}; -use xcm::{latest::MultiLocation, opaque::lts::Junctions::Here}; -use xcm_builder::AsPrefixedGeneralIndex; -use xcm_executor::traits::JustTry; - -/// Whether the multilocation refers to an asset in the local assets pallet or not, -/// and if return the asset id. -fn is_local>( - multilocation: MultiLocation, -) -> Option { - AsPrefixedGeneralIndex::::convert(&multilocation) -} +use xcm::latest::MultiLocation; -pub struct MultiLocationConverter> { - _phantom: PhantomData<(Balances, ParachainLocation)>, +pub struct MultiLocationConverter, MultiLocationMatcher> { + _phantom: PhantomData<(NativeAssetLocation, MultiLocationMatcher)>, } -impl MultiAssetIdConverter, MultiLocation> - for MultiLocationConverter +impl + MultiAssetIdConverter, MultiLocation> + for MultiLocationConverter where - Balances: PalletInfoAccess, - ParachainLocation: Get, + NativeAssetLocation: Get, + MultiLocationMatcher: Contains, { fn get_native() -> Box { - Box::new(MultiLocation { parents: 0, interior: Here }) + Box::new(NativeAssetLocation::get()) } fn is_native(asset_id: &Box) -> bool { - let mut asset_id = asset_id.clone(); - asset_id.simplify(&ParachainLocation::get()); - *asset_id == *Self::get_native() + *asset_id == Self::get_native() } - fn try_convert(asset_id: &Box) -> Result { - let mut asset_id = asset_id.clone(); - asset_id.simplify(&ParachainLocation::get()); + fn try_convert( + asset_id: &Box, + ) -> MultiAssetIdConversionResult, MultiLocation> { if Self::is_native(&asset_id) { - // Otherwise it will try and touch the asset to create an account. - return Err(()) + return MultiAssetIdConversionResult::Native } - // Return simplified MultiLocation: - Ok(*asset_id) - } - fn into_multiasset_id(asset_id: &MultiLocation) -> Box { - let mut asset_id = *asset_id; - asset_id.simplify(&ParachainLocation::get()); - Box::new(asset_id) + if MultiLocationMatcher::contains(&asset_id) { + MultiAssetIdConversionResult::Converted(*asset_id.clone()) + } else { + MultiAssetIdConversionResult::Unsupported(asset_id.clone()) + } } } -pub struct LocalAndForeignAssets { - _phantom: PhantomData<(Assets, ForeignAssets, Location)>, +pub trait MatchesLocalAndForeignAssetsMultiLocation { + fn is_local(location: &MultiLocation) -> bool; + fn is_foreign(location: &MultiLocation) -> bool; } -impl Unbalanced - for LocalAndForeignAssets +pub struct LocalAndForeignAssets { + _phantom: PhantomData<(Assets, LocalAssetIdConverter, ForeignAssets)>, +} + +impl Unbalanced + for LocalAndForeignAssets where - Location: Get, - ForeignAssets: Inspect - + Unbalanced - + Balanced, Assets: Inspect + Unbalanced + Balanced + PalletInfoAccess, + LocalAssetIdConverter: MaybeEquivalence, + ForeignAssets: Inspect + + Unbalanced + + Balanced, { fn handle_dust(dust: frame_support::traits::fungibles::Dust) { let credit = dust.into_credit(); - if let Some(asset) = is_local::(credit.asset()) { + if let Some(asset) = LocalAssetIdConverter::convert(&credit.asset()) { Assets::handle_raw_dust(asset, credit.peek()); } else { ForeignAssets::handle_raw_dust(credit.asset(), credit.peek()); @@ -109,14 +98,11 @@ where } fn write_balance( - asset: >::AssetId, + asset: >::AssetId, who: &AccountId, - amount: >::Balance, - ) -> Result< - Option<>::Balance>, - sp_runtime::DispatchError, - > { - if let Some(asset) = is_local::(asset) { + amount: >::Balance, + ) -> Result>::Balance>, DispatchError> { + if let Some(asset) = LocalAssetIdConverter::convert(&asset) { Assets::write_balance(asset, who, amount) } else { ForeignAssets::write_balance(asset, who, amount) @@ -125,27 +111,55 @@ where /// Set the total issuance of `asset` to `amount`. fn set_total_issuance(asset: Self::AssetId, amount: Self::Balance) { - if let Some(asset) = is_local::(asset) { + if let Some(asset) = LocalAssetIdConverter::convert(&asset) { Assets::set_total_issuance(asset, amount) } else { ForeignAssets::set_total_issuance(asset, amount) } } + + fn decrease_balance( + asset: Self::AssetId, + who: &AccountId, + amount: Self::Balance, + precision: Precision, + preservation: Preservation, + force: Fortitude, + ) -> Result { + if let Some(asset) = LocalAssetIdConverter::convert(&asset) { + Assets::decrease_balance(asset, who, amount, precision, preservation, force) + } else { + ForeignAssets::decrease_balance(asset, who, amount, precision, preservation, force) + } + } + + fn increase_balance( + asset: Self::AssetId, + who: &AccountId, + amount: Self::Balance, + precision: Precision, + ) -> Result { + if let Some(asset) = LocalAssetIdConverter::convert(&asset) { + Assets::increase_balance(asset, who, amount, precision) + } else { + ForeignAssets::increase_balance(asset, who, amount, precision) + } + } } -impl Inspect - for LocalAndForeignAssets +impl Inspect + for LocalAndForeignAssets where - Location: Get, - ForeignAssets: Inspect, Assets: Inspect, + LocalAssetIdConverter: MaybeEquivalence, + ForeignAssets: Inspect, { type AssetId = MultiLocation; type Balance = u128; /// The total amount of issuance in the system. fn total_issuance(asset: Self::AssetId) -> Self::Balance { - if let Some(asset) = is_local::(asset) { + if let Some(asset) = LocalAssetIdConverter::convert(&asset) { Assets::total_issuance(asset) } else { ForeignAssets::total_issuance(asset) @@ -154,16 +168,27 @@ where /// The minimum balance any single account may have. fn minimum_balance(asset: Self::AssetId) -> Self::Balance { - if let Some(asset) = is_local::(asset) { + if let Some(asset) = LocalAssetIdConverter::convert(&asset) { Assets::minimum_balance(asset) } else { ForeignAssets::minimum_balance(asset) } } + fn total_balance( + asset: >::AssetId, + account: &AccountId, + ) -> >::Balance { + if let Some(asset) = LocalAssetIdConverter::convert(&asset) { + Assets::total_balance(asset, account) + } else { + ForeignAssets::total_balance(asset, account) + } + } + /// Get the `asset` balance of `who`. fn balance(asset: Self::AssetId, who: &AccountId) -> Self::Balance { - if let Some(asset) = is_local::(asset) { + if let Some(asset) = LocalAssetIdConverter::convert(&asset) { Assets::balance(asset, who) } else { ForeignAssets::balance(asset, who) @@ -177,7 +202,7 @@ where presevation: Preservation, fortitude: Fortitude, ) -> Self::Balance { - if let Some(asset) = is_local::(asset) { + if let Some(asset) = LocalAssetIdConverter::convert(&asset) { Assets::reducible_balance(asset, who, presevation, fortitude) } else { ForeignAssets::reducible_balance(asset, who, presevation, fortitude) @@ -196,7 +221,7 @@ where amount: Self::Balance, mint: Provenance, ) -> DepositConsequence { - if let Some(asset) = is_local::(asset) { + if let Some(asset) = LocalAssetIdConverter::convert(&asset) { Assets::can_deposit(asset, who, amount, mint) } else { ForeignAssets::can_deposit(asset, who, amount, mint) @@ -210,7 +235,7 @@ where who: &AccountId, amount: Self::Balance, ) -> WithdrawConsequence { - if let Some(asset) = is_local::(asset) { + if let Some(asset) = LocalAssetIdConverter::convert(&asset) { Assets::can_withdraw(asset, who, amount) } else { ForeignAssets::can_withdraw(asset, who, amount) @@ -219,36 +244,25 @@ where /// Returns `true` if an `asset` exists. fn asset_exists(asset: Self::AssetId) -> bool { - if let Some(asset) = is_local::(asset) { + if let Some(asset) = LocalAssetIdConverter::convert(&asset) { Assets::asset_exists(asset) } else { ForeignAssets::asset_exists(asset) } } - - fn total_balance( - asset: >::AssetId, - account: &AccountId, - ) -> >::Balance { - if let Some(asset) = is_local::(asset) { - Assets::total_balance(asset, account) - } else { - ForeignAssets::total_balance(asset, account) - } - } } -impl MutateFungible - for LocalAndForeignAssets +impl Mutate + for LocalAndForeignAssets where - Location: Get, - ForeignAssets: MutateFungible - + Inspect - + Balanced, - Assets: MutateFungible + Assets: Mutate + Inspect + Balanced + PalletInfoAccess, + LocalAssetIdConverter: MaybeEquivalence, + ForeignAssets: Mutate + + Inspect + + Balanced, { /// Transfer funds from one account into another. fn transfer( @@ -258,7 +272,7 @@ where amount: Self::Balance, keep_alive: Preservation, ) -> Result { - if let Some(asset_id) = is_local::(asset) { + if let Some(asset_id) = LocalAssetIdConverter::convert(&asset) { Assets::transfer(asset_id, source, dest, amount, keep_alive) } else { ForeignAssets::transfer(asset, source, dest, amount, keep_alive) @@ -266,12 +280,12 @@ where } } -impl Create - for LocalAndForeignAssets +impl Create + for LocalAndForeignAssets where - Location: Get, - ForeignAssets: Create + Inspect, Assets: Create + Inspect, + LocalAssetIdConverter: MaybeEquivalence, + ForeignAssets: Create + Inspect, { /// Create a new fungible asset. fn create( @@ -280,7 +294,7 @@ where is_sufficient: bool, min_balance: Self::Balance, ) -> DispatchResult { - if let Some(asset_id) = is_local::(asset_id) { + if let Some(asset_id) = LocalAssetIdConverter::convert(&asset_id) { Assets::create(asset_id, admin, is_sufficient, min_balance) } else { ForeignAssets::create(asset_id, admin, is_sufficient, min_balance) @@ -288,19 +302,19 @@ where } } -impl AccountTouch - for LocalAndForeignAssets +impl AccountTouch + for LocalAndForeignAssets where - Location: Get, - ForeignAssets: AccountTouch, Assets: AccountTouch, + LocalAssetIdConverter: MaybeEquivalence, + ForeignAssets: AccountTouch, { type Balance = u128; fn deposit_required( asset_id: MultiLocation, ) -> >::Balance { - if let Some(asset_id) = is_local::(asset_id) { + if let Some(asset_id) = LocalAssetIdConverter::convert(&asset_id) { Assets::deposit_required(asset_id) } else { ForeignAssets::deposit_required(asset_id) @@ -311,8 +325,8 @@ where asset_id: MultiLocation, who: AccountId, depositor: AccountId, - ) -> Result<(), sp_runtime::DispatchError> { - if let Some(asset_id) = is_local::(asset_id) { + ) -> Result<(), DispatchError> { + if let Some(asset_id) = LocalAssetIdConverter::convert(&asset_id) { Assets::touch(asset_id, who, depositor) } else { ForeignAssets::touch(asset_id, who, depositor) @@ -321,16 +335,16 @@ where } /// Implements [`ContainsPair`] trait for a pair of asset and account IDs. -impl ContainsPair - for LocalAndForeignAssets +impl ContainsPair + for LocalAndForeignAssets where - Location: Get, - ForeignAssets: ContainsPair, Assets: PalletInfoAccess + ContainsPair, + LocalAssetIdConverter: MaybeEquivalence, + ForeignAssets: ContainsPair, { /// Check if an account with the given asset ID and account address exists. fn contains(asset_id: &MultiLocation, who: &AccountId) -> bool { - if let Some(asset_id) = is_local::(*asset_id) { + if let Some(asset_id) = LocalAssetIdConverter::convert(asset_id) { Assets::contains(&asset_id, &who) } else { ForeignAssets::contains(&asset_id, &who) @@ -338,33 +352,33 @@ where } } -impl Balanced - for LocalAndForeignAssets +impl Balanced + for LocalAndForeignAssets where - Location: Get, - ForeignAssets: - Balanced + Inspect, Assets: Balanced + Inspect + PalletInfoAccess, + LocalAssetIdConverter: MaybeEquivalence, + ForeignAssets: + Balanced + Inspect, { - type OnDropDebt = DebtDropIndirection; - type OnDropCredit = CreditDropIndirection; + type OnDropDebt = DebtDropIndirection; + type OnDropCredit = CreditDropIndirection; } -pub struct DebtDropIndirection { - _phantom: PhantomData>, +pub struct DebtDropIndirection { + _phantom: PhantomData>, } -impl HandleImbalanceDrop - for DebtDropIndirection +impl HandleImbalanceDrop + for DebtDropIndirection where - Location: Get, + Assets: Balanced + Inspect, + LocalAssetIdConverter: MaybeEquivalence, ForeignAssets: Balanced + Inspect, - Assets: Balanced + Inspect, { fn handle(asset: MultiLocation, amount: u128) { - if let Some(asset_id) = is_local::(asset) { + if let Some(asset_id) = LocalAssetIdConverter::convert(&asset) { Assets::OnDropDebt::handle(asset_id, amount); } else { ForeignAssets::OnDropDebt::handle(asset, amount); @@ -372,23 +386,87 @@ where } } -pub struct CreditDropIndirection { - _phantom: PhantomData>, +pub struct CreditDropIndirection { + _phantom: PhantomData>, } -impl HandleImbalanceDrop - for CreditDropIndirection +impl HandleImbalanceDrop + for CreditDropIndirection where - Location: Get, + Assets: Balanced + Inspect, + LocalAssetIdConverter: MaybeEquivalence, ForeignAssets: Balanced + Inspect, - Assets: Balanced + Inspect, { fn handle(asset: MultiLocation, amount: u128) { - if let Some(asset_id) = is_local::(asset) { + if let Some(asset_id) = LocalAssetIdConverter::convert(&asset) { Assets::OnDropCredit::handle(asset_id, amount); } else { ForeignAssets::OnDropCredit::handle(asset, amount); } } } + +#[cfg(test)] +mod tests { + use crate::{ + local_and_foreign_assets::MultiLocationConverter, matching::StartsWith, + AssetIdForPoolAssetsConvert, AssetIdForTrustBackedAssetsConvert, + }; + use frame_support::traits::EverythingBut; + use pallet_asset_conversion::{MultiAssetIdConversionResult, MultiAssetIdConverter}; + use sp_runtime::traits::MaybeEquivalence; + use xcm::latest::prelude::*; + + #[test] + fn test_multi_location_converter_works() { + frame_support::parameter_types! { + pub const WestendLocation: MultiLocation = MultiLocation::parent(); + pub TrustBackedAssetsPalletLocation: MultiLocation = PalletInstance(50_u8).into(); + pub PoolAssetsPalletLocation: MultiLocation = PalletInstance(55_u8).into(); + } + + type C = MultiLocationConverter< + WestendLocation, + EverythingBut>, + >; + + let native_asset = WestendLocation::get(); + let local_asset = + AssetIdForTrustBackedAssetsConvert::::convert_back( + &123, + ) + .unwrap(); + let pool_asset = + AssetIdForPoolAssetsConvert::::convert_back(&456).unwrap(); + let foreign_asset1 = MultiLocation { parents: 1, interior: X1(Parachain(2222)) }; + let foreign_asset2 = MultiLocation { + parents: 2, + interior: X2(GlobalConsensus(ByGenesis([1; 32])), Parachain(2222)), + }; + + assert!(C::is_native(&Box::new(native_asset))); + assert!(!C::is_native(&Box::new(local_asset))); + assert!(!C::is_native(&Box::new(pool_asset))); + assert!(!C::is_native(&Box::new(foreign_asset1))); + assert!(!C::is_native(&Box::new(foreign_asset2))); + + assert_eq!(C::try_convert(&Box::new(native_asset)), MultiAssetIdConversionResult::Native); + assert_eq!( + C::try_convert(&Box::new(local_asset)), + MultiAssetIdConversionResult::Converted(local_asset) + ); + assert_eq!( + C::try_convert(&Box::new(pool_asset)), + MultiAssetIdConversionResult::Unsupported(Box::new(pool_asset)) + ); + assert_eq!( + C::try_convert(&Box::new(foreign_asset1)), + MultiAssetIdConversionResult::Converted(foreign_asset1) + ); + assert_eq!( + C::try_convert(&Box::new(foreign_asset2)), + MultiAssetIdConversionResult::Converted(foreign_asset2) + ); + } +} diff --git a/parachains/runtimes/assets/test-utils/src/test_cases.rs b/parachains/runtimes/assets/test-utils/src/test_cases.rs index 162239a8d2a..375da28720e 100644 --- a/parachains/runtimes/assets/test-utils/src/test_cases.rs +++ b/parachains/runtimes/assets/test-utils/src/test_cases.rs @@ -33,6 +33,9 @@ use sp_runtime::{ use xcm::latest::prelude::*; use xcm_executor::{traits::ConvertLocation, XcmExecutor}; +// Re-export test_case from `parachains-runtimes-test-utils` +pub use parachains_runtimes_test_utils::test_cases::change_storage_constant_by_governance_works; + /// Test-case makes sure that `Runtime` can receive native asset from relay chain /// and can teleport it back and to the other parachains pub fn teleports_for_native_asset_works< 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 e7c8216e644..967aadf9ddf 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -688,6 +688,7 @@ impl_runtime_apis! { MultiAsset { fun: Fungible(UNITS), id: Concrete(KsmRelayLocation::get()) }, )); pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; + pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None; } impl pallet_xcm_benchmarks::fungible::Config for Runtime { @@ -695,6 +696,7 @@ impl_runtime_apis! { type CheckedAccount = CheckedAccount; type TrustedTeleporter = TrustedTeleporter; + type TrustedReserve = TrustedReserve; fn get_multi_asset() -> MultiAsset { MultiAsset { diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs index b82c3a461e9..5c9c880ec9b 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -688,6 +688,7 @@ impl_runtime_apis! { MultiAsset { fun: Fungible(UNITS), id: Concrete(DotRelayLocation::get()) }, )); pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; + pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None; } impl pallet_xcm_benchmarks::fungible::Config for Runtime { @@ -695,6 +696,7 @@ impl_runtime_apis! { type CheckedAccount = CheckedAccount; type TrustedTeleporter = TrustedTeleporter; + type TrustedReserve = TrustedReserve; fn get_multi_asset() -> MultiAsset { MultiAsset { 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 c4bfa641db0..6e1bb7aba2d 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -956,6 +956,7 @@ impl_runtime_apis! { MultiAsset { fun: Fungible(UNITS), id: Concrete(RelayLocation::get()) }, )); pub const CheckedAccount: Option<(AccountId, xcm_builder::MintLocation)> = None; + pub const TrustedReserve: Option<(MultiLocation, MultiAsset)> = None; } impl pallet_xcm_benchmarks::fungible::Config for Runtime { @@ -963,6 +964,7 @@ impl_runtime_apis! { type CheckedAccount = CheckedAccount; type TrustedTeleporter = TrustedTeleporter; + type TrustedReserve = TrustedReserve; fn get_multi_asset() -> MultiAsset { MultiAsset { diff --git a/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs b/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs index 03be3f28619..ee9d413b7a7 100644 --- a/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs +++ b/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs @@ -54,6 +54,9 @@ use xcm_executor::XcmExecutor; // Re-export test_case from assets pub use asset_test_utils::include_teleports_for_native_asset_works; +// Re-export test_case from `parachains-runtimes-test-utils` +pub use parachains_runtimes_test_utils::test_cases::change_storage_constant_by_governance_works; + /// Test-case makes sure that `Runtime` can process bridging initialize via governance-like call pub fn initialize_bridge_by_governance_works( collator_session_key: CollatorSessionKeys, @@ -114,76 +117,6 @@ pub fn initialize_bridge_by_governance_works( }) } -/// Test-case makes sure that `Runtime` can change storage constant via governance-like call -pub fn change_storage_constant_by_governance_works( - collator_session_key: CollatorSessionKeys, - runtime_para_id: u32, - runtime_call_encode: Box) -> Vec>, - storage_constant_key_value: fn() -> (Vec, StorageConstantType), - new_storage_constant_value: fn(&StorageConstantType) -> StorageConstantType, -) where - Runtime: frame_system::Config - + pallet_balances::Config - + pallet_session::Config - + pallet_xcm::Config - + parachain_info::Config - + pallet_collator_selection::Config - + cumulus_pallet_dmp_queue::Config - + cumulus_pallet_parachain_system::Config, - ValidatorIdOf: From>, - StorageConstant: Get, - StorageConstantType: Encode + PartialEq + std::fmt::Debug, -{ - ExtBuilder::::default() - .with_collators(collator_session_key.collators()) - .with_session_keys(collator_session_key.session_keys()) - .with_para_id(runtime_para_id.into()) - .with_tracing() - .build() - .execute_with(|| { - let (storage_constant_key, storage_constant_init_value): ( - Vec, - StorageConstantType, - ) = storage_constant_key_value(); - - // check delivery reward constant before (not stored yet, just as default value is used) - assert_eq!(StorageConstant::get(), storage_constant_init_value); - assert_eq!(sp_io::storage::get(&storage_constant_key), None); - - let new_storage_constant_value = - new_storage_constant_value(&storage_constant_init_value); - assert_ne!(new_storage_constant_value, storage_constant_init_value); - - // encode `set_storage` call - let set_storage_call = - runtime_call_encode(frame_system::Call::::set_storage { - items: vec![( - storage_constant_key.clone(), - new_storage_constant_value.encode(), - )], - }); - - // estimate - storing just 1 value - use frame_system::WeightInfo; - let require_weight_at_most = - ::SystemWeightInfo::set_storage(1); - - // execute XCM with Transact to `set_storage` as governance does - assert_ok!(RuntimeHelper::::execute_as_governance( - set_storage_call, - require_weight_at_most - ) - .ensure_complete()); - - // check delivery reward constant after (stored) - assert_eq!(StorageConstant::get(), new_storage_constant_value); - assert_eq!( - sp_io::storage::get(&storage_constant_key), - Some(new_storage_constant_value.encode().into()) - ); - }) -} - /// Test-case makes sure that `Runtime` can handle xcm `ExportMessage`: /// Checks if received XCM messages is correctly added to the message outbound queue for delivery. /// For SystemParachains we expect unpaid execution. diff --git a/parachains/runtimes/test-utils/src/lib.rs b/parachains/runtimes/test-utils/src/lib.rs index 9328ac492d3..5623ce46069 100644 --- a/parachains/runtimes/test-utils/src/lib.rs +++ b/parachains/runtimes/test-utils/src/lib.rs @@ -37,6 +37,8 @@ use xcm::{ }; use xcm_executor::{traits::TransactAsset, Assets}; +pub mod test_cases; + pub type BalanceOf = ::Balance; pub type AccountIdOf = ::AccountId; pub type ValidatorIdOf = ::ValidatorId; diff --git a/parachains/runtimes/test-utils/src/test_cases.rs b/parachains/runtimes/test-utils/src/test_cases.rs new file mode 100644 index 00000000000..7d5d9327c00 --- /dev/null +++ b/parachains/runtimes/test-utils/src/test_cases.rs @@ -0,0 +1,91 @@ +// Copyright (C) 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 . + +//! Module contains predefined test-case scenarios for `Runtime` with common functionality. + +use crate::{AccountIdOf, CollatorSessionKeys, ExtBuilder, RuntimeHelper, ValidatorIdOf}; +use codec::Encode; +use frame_support::{assert_ok, traits::Get}; + +/// Test-case makes sure that `Runtime` can change storage constant via governance-like call +pub fn change_storage_constant_by_governance_works( + collator_session_key: CollatorSessionKeys, + runtime_para_id: u32, + runtime_call_encode: Box) -> Vec>, + storage_constant_key_value: fn() -> (Vec, StorageConstantType), + new_storage_constant_value: fn(&StorageConstantType) -> StorageConstantType, +) where + Runtime: frame_system::Config + + pallet_balances::Config + + pallet_session::Config + + pallet_xcm::Config + + parachain_info::Config + + pallet_collator_selection::Config + + cumulus_pallet_dmp_queue::Config + + cumulus_pallet_parachain_system::Config, + ValidatorIdOf: From>, + StorageConstant: Get, + StorageConstantType: Encode + PartialEq + std::fmt::Debug, +{ + ExtBuilder::::default() + .with_collators(collator_session_key.collators()) + .with_session_keys(collator_session_key.session_keys()) + .with_para_id(runtime_para_id.into()) + .with_tracing() + .build() + .execute_with(|| { + let (storage_constant_key, storage_constant_init_value): ( + Vec, + StorageConstantType, + ) = storage_constant_key_value(); + + // check delivery reward constant before (not stored yet, just as default value is used) + assert_eq!(StorageConstant::get(), storage_constant_init_value); + assert_eq!(sp_io::storage::get(&storage_constant_key), None); + + let new_storage_constant_value = + new_storage_constant_value(&storage_constant_init_value); + assert_ne!(new_storage_constant_value, storage_constant_init_value); + + // encode `set_storage` call + let set_storage_call = + runtime_call_encode(frame_system::Call::::set_storage { + items: vec![( + storage_constant_key.clone(), + new_storage_constant_value.encode(), + )], + }); + + // estimate - storing just 1 value + use frame_system::WeightInfo; + let require_weight_at_most = + ::SystemWeightInfo::set_storage(1); + + // execute XCM with Transact to `set_storage` as governance does + assert_ok!(RuntimeHelper::::execute_as_governance( + set_storage_call, + require_weight_at_most + ) + .ensure_complete()); + + // check delivery reward constant after (stored) + assert_eq!(StorageConstant::get(), new_storage_constant_value); + assert_eq!( + sp_io::storage::get(&storage_constant_key), + Some(new_storage_constant_value.encode().into()) + ); + }) +} diff --git a/xcm/xcm-emulator/src/lib.rs b/xcm/xcm-emulator/src/lib.rs index e534d25a8c5..0b5a6eec4a2 100644 --- a/xcm/xcm-emulator/src/lib.rs +++ b/xcm/xcm-emulator/src/lib.rs @@ -1100,8 +1100,8 @@ pub mod helpers { pub fn within_threshold(threshold: u64, expected_value: u64, current_value: u64) -> bool { let margin = (current_value * threshold) / 100; - let lower_limit = expected_value - margin; - let upper_limit = expected_value + margin; + let lower_limit = expected_value.checked_sub(margin).unwrap_or(u64::MIN); + let upper_limit = expected_value.checked_add(margin).unwrap_or(u64::MAX); current_value >= lower_limit && current_value <= upper_limit } From f022e035da204a1c71fc633054fe24b6a4033680 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Sat, 22 Jul 2023 08:30:28 +0200 Subject: [PATCH 10/17] Run all benchmarks "as tests" in short setup on every PR (#2846) * Run all benchmarks "as tests" in short setup on every PR * Fix * Update scripts/ci/gitlab/pipeline/short-benchmarks.yml Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> * Updated TODO * Removed `--execution wasm` * [asset-conv] Unused Balances type * [asset-conv] native asset change * Dedicated `AssetBalance` type for `pallet_assets` instances * Improved local vs foreign asset handling + test for not allowing pool_assets in pool * Removed `into_multiasset_id` * Fix * Refactor * Fixed create_pool for benchmark with LocalAndForeignAssets (finally found it) * Revert * fmt * Migrates pools with `MultiLocation { parents: 0, interior: Here }` to `MultiLocation { parents: 1, interior: Here }` * Allow `set_storage` for `AllowMultiAssetPools` / `LiquidityWithdrawalFee` * Benchmarks work * Removed comment + more defensive migration * `T::Currency::transfer` -> `Balances::transfer_all` in migration * Change pool_id in migration --------- Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> Co-authored-by: parity-processbot <> --- .gitlab-ci.yml | 6 ++ scripts/ci/gitlab/pipeline/build.yml | 15 +++++ .../ci/gitlab/pipeline/short-benchmarks.yml | 56 +++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 scripts/ci/gitlab/pipeline/short-benchmarks.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 96d977ac513..f032901c6f4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,11 +7,14 @@ stages: - test - build + # used for manual job run for regenerate weights for release-* branches (not needed anymore, just leave it here for a while as PlanB) - benchmarks-build + # used for manual job run for regenerate weights for release-* branches (not needed anymore, just leave it here for a while as PlanB) - benchmarks-run - publish - integration-tests - zombienet + - short-benchmarks default: interruptible: true @@ -142,7 +145,10 @@ include: - scripts/ci/gitlab/pipeline/test.yml # # build jobs - scripts/ci/gitlab/pipeline/build.yml + # short-benchmarks jobs + - scripts/ci/gitlab/pipeline/short-benchmarks.yml # # benchmarks jobs + # # used for manual job run for regenerate weights for release-* branches (not needed anymore, just leave it here for a while as PlanB) - scripts/ci/gitlab/pipeline/benchmarks.yml # # publish jobs - scripts/ci/gitlab/pipeline/publish.yml diff --git a/scripts/ci/gitlab/pipeline/build.yml b/scripts/ci/gitlab/pipeline/build.yml index e4678727e9b..b200e61deb0 100644 --- a/scripts/ci/gitlab/pipeline/build.yml +++ b/scripts/ci/gitlab/pipeline/build.yml @@ -121,3 +121,18 @@ build-runtime-testing: needs: - job: build-runtime-starters artifacts: false + +build-short-benchmark: + stage: build + extends: + - .docker-env + - .common-refs + - .collect-artifacts + # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs + needs: + - job: check-rustdoc + artifacts: false + script: + - cargo build --profile release --locked --features=runtime-benchmarks + - mkdir -p ./artifacts + - cp ./target/release/polkadot-parachain ./artifacts/ diff --git a/scripts/ci/gitlab/pipeline/short-benchmarks.yml b/scripts/ci/gitlab/pipeline/short-benchmarks.yml new file mode 100644 index 00000000000..f63ad1e0d04 --- /dev/null +++ b/scripts/ci/gitlab/pipeline/short-benchmarks.yml @@ -0,0 +1,56 @@ +# This file is part of .gitlab-ci.yml +# Here are all jobs that are executed during "short-benchmarks" stage + +# Run all pallet benchmarks only once to check if there are any errors +.short-benchmark-template: &short-bench + stage: short-benchmarks + extends: + - .common-refs + - .docker-env + needs: + - job: build-short-benchmark + artifacts: true + variables: + RUNTIME_CHAIN: benchmarked-runtime-chain + script: + - ./artifacts/polkadot-parachain benchmark pallet --wasm-execution compiled --chain $RUNTIME_CHAIN --pallet "*" --extrinsic "*" --steps 2 --repeat 1 + +short-benchmark-asset-hub-polkadot: + <<: *short-bench + variables: + RUNTIME_CHAIN: asset-hub-polkadot-dev + +short-benchmark-asset-hub-kusama: + <<: *short-bench + variables: + RUNTIME_CHAIN: asset-hub-kusama-dev + +short-benchmark-asset-hub-westend: + <<: *short-bench + variables: + RUNTIME_CHAIN: asset-hub-westend-dev + +short-benchmark-bridge-hub-polkadot: + <<: *short-bench + variables: + RUNTIME_CHAIN: bridge-hub-polkadot-dev + +short-benchmark-bridge-hub-kusama: + <<: *short-bench + variables: + RUNTIME_CHAIN: bridge-hub-kusama-dev + +short-benchmark-bridge-hub-rococo: + <<: *short-bench + variables: + RUNTIME_CHAIN: bridge-hub-rococo-dev + +short-benchmark-collectives-polkadot : + <<: *short-bench + variables: + RUNTIME_CHAIN: collectives-polkadot-dev + +short-benchmark-glutton-kusama : + <<: *short-bench + variables: + RUNTIME_CHAIN: glutton-kusama-dev-1300 From b501f0254467e2bbd60d4796fe84840b56f5218f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 22 Jul 2023 13:50:44 +0000 Subject: [PATCH 11/17] Bump thiserror from 1.0.43 to 1.0.44 (#2922) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.43 to 1.0.44. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.43...1.0.44) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- client/consensus/proposer/Cargo.toml | 2 +- client/relay-chain-interface/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bb8fdf1c72c..66ee18998a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14610,18 +14610,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", diff --git a/client/consensus/proposer/Cargo.toml b/client/consensus/proposer/Cargo.toml index b8179e5c8c3..15d3816f993 100644 --- a/client/consensus/proposer/Cargo.toml +++ b/client/consensus/proposer/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] anyhow = "1.0" async-trait = "0.1.71" -thiserror = "1.0.43" +thiserror = "1.0.44" # Substrate sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/client/relay-chain-interface/Cargo.toml b/client/relay-chain-interface/Cargo.toml index 1facab311fc..8c845448beb 100644 --- a/client/relay-chain-interface/Cargo.toml +++ b/client/relay-chain-interface/Cargo.toml @@ -16,6 +16,6 @@ sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "mas futures = "0.3.28" async-trait = "0.1.71" -thiserror = "1.0.43" +thiserror = "1.0.44" jsonrpsee-core = "0.16.2" parity-scale-codec = "3.6.4" From f90d8fce609576561a33ecd4c653593269bb6f74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 22 Jul 2023 13:52:11 +0000 Subject: [PATCH 12/17] Bump num-traits from 0.2.15 to 0.2.16 (#2921) Bumps [num-traits](https://github.com/rust-num/num-traits) from 0.2.15 to 0.2.16. - [Changelog](https://github.com/rust-num/num-traits/blob/master/RELEASES.md) - [Commits](https://github.com/rust-num/num-traits/compare/num-traits-0.2.15...num-traits-0.2.16) --- updated-dependencies: - dependency-name: num-traits dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 66ee18998a0..dea77bbb3c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7149,9 +7149,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] From 90a7d8e507fa2b8553d4bf58f0934c949a0bd0ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 22 Jul 2023 15:49:26 +0000 Subject: [PATCH 13/17] Bump async-trait from 0.1.71 to 0.1.72 (#2920) Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.71 to 0.1.72. - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.71...0.1.72) --- updated-dependencies: - dependency-name: async-trait dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- client/consensus/aura/Cargo.toml | 2 +- client/consensus/common/Cargo.toml | 2 +- client/consensus/proposer/Cargo.toml | 2 +- client/consensus/relay-chain/Cargo.toml | 2 +- client/network/Cargo.toml | 2 +- client/pov-recovery/Cargo.toml | 2 +- client/relay-chain-inprocess-interface/Cargo.toml | 2 +- client/relay-chain-interface/Cargo.toml | 2 +- client/relay-chain-minimal-node/Cargo.toml | 2 +- client/relay-chain-rpc-interface/Cargo.toml | 2 +- polkadot-parachain/Cargo.toml | 2 +- primitives/parachain-inherent/Cargo.toml | 2 +- test/service/Cargo.toml | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dea77bbb3c1..438a2553592 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -808,9 +808,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.71" +version = "0.1.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" +checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" dependencies = [ "proc-macro2", "quote", diff --git a/client/consensus/aura/Cargo.toml b/client/consensus/aura/Cargo.toml index c18ff8d5b0c..2faf1518f63 100644 --- a/client/consensus/aura/Cargo.toml +++ b/client/consensus/aura/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] edition = "2021" [dependencies] -async-trait = "0.1.71" +async-trait = "0.1.72" codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] } futures = "0.3.28" tracing = "0.1.37" diff --git a/client/consensus/common/Cargo.toml b/client/consensus/common/Cargo.toml index 9457e4dc3ad..6f42666e36a 100644 --- a/client/consensus/common/Cargo.toml +++ b/client/consensus/common/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] edition = "2021" [dependencies] -async-trait = "0.1.71" +async-trait = "0.1.72" codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] } dyn-clone = "1.0.12" futures = "0.3.28" diff --git a/client/consensus/proposer/Cargo.toml b/client/consensus/proposer/Cargo.toml index 15d3816f993..837a5f5c264 100644 --- a/client/consensus/proposer/Cargo.toml +++ b/client/consensus/proposer/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] anyhow = "1.0" -async-trait = "0.1.71" +async-trait = "0.1.72" thiserror = "1.0.44" # Substrate diff --git a/client/consensus/relay-chain/Cargo.toml b/client/consensus/relay-chain/Cargo.toml index 658338e82e6..7f3439eff8a 100644 --- a/client/consensus/relay-chain/Cargo.toml +++ b/client/consensus/relay-chain/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Parity Technologies "] edition = "2021" [dependencies] -async-trait = "0.1.71" +async-trait = "0.1.72" futures = "0.3.28" parking_lot = "0.12.1" tracing = "0.1.37" diff --git a/client/network/Cargo.toml b/client/network/Cargo.toml index b0314648558..fac1872f47b 100644 --- a/client/network/Cargo.toml +++ b/client/network/Cargo.toml @@ -6,7 +6,7 @@ description = "Cumulus-specific networking protocol" edition = "2021" [dependencies] -async-trait = "0.1.71" +async-trait = "0.1.72" codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] } futures = "0.3.28" futures-timer = "3.0.2" diff --git a/client/pov-recovery/Cargo.toml b/client/pov-recovery/Cargo.toml index 7817d1d4d65..0d4d0a0f3c7 100644 --- a/client/pov-recovery/Cargo.toml +++ b/client/pov-recovery/Cargo.toml @@ -28,7 +28,7 @@ polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = # Cumulus cumulus-primitives-core = { path = "../../primitives/core" } cumulus-relay-chain-interface = {path = "../relay-chain-interface"} -async-trait = "0.1.71" +async-trait = "0.1.72" [dev-dependencies] tokio = { version = "1.29.1", features = ["macros"] } diff --git a/client/relay-chain-inprocess-interface/Cargo.toml b/client/relay-chain-inprocess-interface/Cargo.toml index c2fcb04f3be..43aaa44177b 100644 --- a/client/relay-chain-inprocess-interface/Cargo.toml +++ b/client/relay-chain-inprocess-interface/Cargo.toml @@ -5,7 +5,7 @@ version = "0.1.0" edition = "2021" [dependencies] -async-trait = "0.1.71" +async-trait = "0.1.72" futures = "0.3.28" futures-timer = "3.0.2" diff --git a/client/relay-chain-interface/Cargo.toml b/client/relay-chain-interface/Cargo.toml index 8c845448beb..c8f08d1454c 100644 --- a/client/relay-chain-interface/Cargo.toml +++ b/client/relay-chain-interface/Cargo.toml @@ -15,7 +15,7 @@ sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = " sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } futures = "0.3.28" -async-trait = "0.1.71" +async-trait = "0.1.72" thiserror = "1.0.44" jsonrpsee-core = "0.16.2" parity-scale-codec = "3.6.4" diff --git a/client/relay-chain-minimal-node/Cargo.toml b/client/relay-chain-minimal-node/Cargo.toml index 96d635051e0..92206e19c00 100644 --- a/client/relay-chain-minimal-node/Cargo.toml +++ b/client/relay-chain-minimal-node/Cargo.toml @@ -40,6 +40,6 @@ cumulus-primitives-core = { path = "../../primitives/core" } array-bytes = "6.1" lru = "0.9" tracing = "0.1.37" -async-trait = "0.1.71" +async-trait = "0.1.72" futures = "0.3.28" tokio = { version = "1.29.1", features = ["macros"] } diff --git a/client/relay-chain-rpc-interface/Cargo.toml b/client/relay-chain-rpc-interface/Cargo.toml index aaf6f08b549..4b2c563fbda 100644 --- a/client/relay-chain-rpc-interface/Cargo.toml +++ b/client/relay-chain-rpc-interface/Cargo.toml @@ -28,7 +28,7 @@ futures-timer = "3.0.2" parity-scale-codec = "3.6.4" jsonrpsee = { version = "0.16.2", features = ["ws-client"] } tracing = "0.1.37" -async-trait = "0.1.71" +async-trait = "0.1.72" url = "2.4.0" serde_json = "1.0.103" serde = "1.0.171" diff --git a/polkadot-parachain/Cargo.toml b/polkadot-parachain/Cargo.toml index a1abaa32101..317852ae9e0 100644 --- a/polkadot-parachain/Cargo.toml +++ b/polkadot-parachain/Cargo.toml @@ -11,7 +11,7 @@ name = "polkadot-parachain" path = "src/main.rs" [dependencies] -async-trait = "0.1.71" +async-trait = "0.1.72" clap = { version = "4.3.17", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } futures = "0.3.28" diff --git a/primitives/parachain-inherent/Cargo.toml b/primitives/parachain-inherent/Cargo.toml index fff0226f8e5..9c81a688d67 100644 --- a/primitives/parachain-inherent/Cargo.toml +++ b/primitives/parachain-inherent/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] edition = "2021" [dependencies] -async-trait = { version = "0.1.71", optional = true } +async-trait = { version = "0.1.72", optional = true } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive" ] } scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } tracing = { version = "0.1.37", optional = true } diff --git a/test/service/Cargo.toml b/test/service/Cargo.toml index 0c46a915737..d48eb16bab5 100644 --- a/test/service/Cargo.toml +++ b/test/service/Cargo.toml @@ -9,7 +9,7 @@ name = "test-parachain" path = "src/main.rs" [dependencies] -async-trait = "0.1.71" +async-trait = "0.1.72" clap = { version = "4.3.17", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } criterion = { version = "0.5.1", features = [ "async_tokio" ] } From bdf247d407ad3d47fbf03ee4de5dbe05db34ba1e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 22 Jul 2023 15:49:45 +0000 Subject: [PATCH 14/17] Bump anyhow from 1.0.71 to 1.0.72 (#2906) Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.71 to 1.0.72. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.71...1.0.72) --- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 438a2553592..7b18e63a938 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -262,9 +262,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" [[package]] name = "approx" From 24c11e6101df20142f67f4879274acd39b081a9c Mon Sep 17 00:00:00 2001 From: Egor_P Date: Mon, 24 Jul 2023 13:33:05 +0200 Subject: [PATCH 15/17] Fix PR name (#2926) --- scripts/ci/gitlab/pipeline/benchmarks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/gitlab/pipeline/benchmarks.yml b/scripts/ci/gitlab/pipeline/benchmarks.yml index 011e750a735..63b66d485ed 100644 --- a/scripts/ci/gitlab/pipeline/benchmarks.yml +++ b/scripts/ci/gitlab/pipeline/benchmarks.yml @@ -28,7 +28,7 @@ benchmarks-assets: - export CURRENT_TIME=$(date '+%s') - export BRANCHNAME="weights-asset-hub-polkadot-${CI_COMMIT_BRANCH}-${CURRENT_TIME}" - !reference [.git-commit-push, script] - - ./scripts/ci/create-benchmark-pr.sh "[benchmarks] Update weights for asset-hub-kusama/t" "$BRANCHNAME" + - ./scripts/ci/create-benchmark-pr.sh "[benchmarks] Update weights for asset-hub-kusama/-polkadot" "$BRANCHNAME" - rm -f ./artifacts/polkadot-parachain - rm -f ./artifacts/test-parachain after_script: From c14e538bfc94c759aa8aab40b9b83a7fb1b1aae7 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 24 Jul 2023 16:16:08 +0200 Subject: [PATCH 16/17] BHs readme nits (#2754) * Correct BH readme * Zombienet renaming * TOC * Apply suggestions from code review Co-authored-by: Adrian Catangiu * Updated REAMDE.md * Alice -> Bob for e2e --------- Co-authored-by: Adrian Catangiu Co-authored-by: parity-processbot <> --- .../emulated/common/src/constants.rs | 8 +- parachains/runtimes/bridge-hubs/README.md | 141 ++++++++---------- .../bridge_hub_rococo_local_network.toml | 4 +- .../bridge_hub_wococo_local_network.toml | 4 +- 4 files changed, 69 insertions(+), 88 deletions(-) diff --git a/parachains/integration-tests/emulated/common/src/constants.rs b/parachains/integration-tests/emulated/common/src/constants.rs index 7c3eaba5956..b3f78c23181 100644 --- a/parachains/integration-tests/emulated/common/src/constants.rs +++ b/parachains/integration-tests/emulated/common/src/constants.rs @@ -953,19 +953,19 @@ pub mod bridge_hub_rococo { ..Default::default() }, bridge_wococo_grandpa: bridge_hub_rococo_runtime::BridgeWococoGrandpaConfig { - owner: Some(get_account_id_from_seed::("Alice")), + owner: Some(get_account_id_from_seed::(accounts::BOB)), ..Default::default() }, bridge_rococo_grandpa: bridge_hub_rococo_runtime::BridgeRococoGrandpaConfig { - owner: Some(get_account_id_from_seed::("Alice")), + owner: Some(get_account_id_from_seed::(accounts::BOB)), ..Default::default() }, bridge_rococo_messages: bridge_hub_rococo_runtime::BridgeRococoMessagesConfig { - owner: Some(get_account_id_from_seed::("Alice")), + owner: Some(get_account_id_from_seed::(accounts::BOB)), ..Default::default() }, bridge_wococo_messages: bridge_hub_rococo_runtime::BridgeWococoMessagesConfig { - owner: Some(get_account_id_from_seed::("Alice")), + owner: Some(get_account_id_from_seed::(accounts::BOB)), ..Default::default() }, ..Default::default() diff --git a/parachains/runtimes/bridge-hubs/README.md b/parachains/runtimes/bridge-hubs/README.md index b187f1da2db..1520065b7e3 100644 --- a/parachains/runtimes/bridge-hubs/README.md +++ b/parachains/runtimes/bridge-hubs/README.md @@ -1,15 +1,13 @@ - [Bridge-hub Parachains](#bridge-hub-parachains) - * [Requirements for local run/testing](#requirements-for-local-run-testing) - * [How to test locally Rococo <-> Wococo bridge](#how-to-test-locally-rococo-----wococo-bridge) - + [Run chains (Rococo + BridgeHub, Wococo + BridgeHub) with zombienet](#run-chains--rococo---bridgehub--wococo---bridgehub--with-zombienet) - + [Run relayer (BridgeHubRococo, BridgeHubWococo)](#run-relayer--bridgehubrococo--bridgehubwococo-) - - [Run with script (alternative 1)](#run-with-script--alternative-1-) - - [Run with binary (alternative 2)](#run-with-binary--alternative-2-) - + [Send messages](#send-messages) - - [Local zombienet run](#local-zombienet-run) - - [Live Rockmine2 to Wockmint](#live-rockmine2-to-wockmint) - * [How to test local BridgeHubKusama](#how-to-test-local-bridgehubkusama) - * [How to test local BridgeHubPolkadot](#how-to-test-local-bridgehubpolkadot) + * [Requirements for local run/testing](#requirements-for-local-runtesting) + * [How to test local Rococo <-> Wococo bridge](#how-to-test-local-rococo---wococo-bridge) + + [Run chains (Rococo + BridgeHub, Wococo + BridgeHub) with zombienet](#run-chains-rococo--bridgehub-wococo--bridgehub-with-zombienet) + + [Run relayer (BridgeHubRococo, BridgeHubWococo)](#run-relayer-bridgehubrococo-bridgehubwococo) + - [Run with script (alternative 1)](#run-with-script-alternative-1) + - [Run with binary (alternative 2)](#run-with-binary-alternative-2) + + [Send messages - transfer asset over bridge](#send-messages---transfer-asset-over-bridge) + * [How to test live BridgeHubRococo/BridgeHubWococo](#how-to-test-live-bridgehubrococobridgehubwococo) + * [How to test local BridgeHubKusama/BridgeHubPolkadot](#how-to-test-local-bridgehubkusamabridgehubpolkadot) # Bridge-hub Parachains @@ -41,6 +39,7 @@ mkdir -p ~/local_bridge_testing/logs Go to: https://github.com/paritytech/zombienet/releases Copy the apropriate binary (zombienet-linux) from the latest release to ~/local_bridge_testing/bin + --- # 2. Build polkadot binary git clone https://github.com/paritytech/polkadot.git @@ -49,60 +48,81 @@ cd polkadot # if you want to test Kusama/Polkadot bridge, we need "sudo pallet + fast-runtime", # so please, find the latest polkadot's repository branch `it/release-vX.Y.Z-fast-sudo` # e.g: -# git checkout -b it/release-v0.9.42-fast-sudo --track origin/it/release-v0.9.42-fast-sudo +# git checkout -b it/release-v0.9.43-fast-sudo --track origin/it/release-v0.9.43-fast-sudo cargo build --release --features fast-runtime cp target/release/polkadot ~/local_bridge_testing/bin/polkadot ---- -# 3. Build cumulus polkadot-parachain binary -cd - -# checkout desired branch or use master: -# git checkout -b master --track origin/master - -cargo build --release --locked -p polkadot-parachain-bin -cp target/release/polkadot-parachain ~/local_bridge_testing/bin/polkadot-parachain -cp target/release/polkadot-parachain ~/local_bridge_testing/bin/polkadot-parachain-mint --- -# 4. Build substrate-relay binary +# 3. Build substrate-relay binary git clone https://github.com/paritytech/parity-bridges-common.git cd parity-bridges-common # checkout desired branch or use master: # git checkout -b master --track origin/master +# `polkadot-staging` (recommended) is stabilized and compatible for Cumulus releases +# `master` is latest development git checkout -b polkadot-staging --track origin/polkadot-staging cargo build --release -p substrate-relay cp target/release/substrate-relay ~/local_bridge_testing/bin/substrate-relay + --- -# 5. Build polkadot-parachain-mint binary with `asset-hub-kusama`/`asset-hub-westend` for moving assets +# 4. Build cumulus polkadot-parachain binary cd -# TODO:check-parameter - change this when merged to master -git checkout -b bko-transfer-asset-via-bridge --track origin/bko-transfer-asset-via-bridge -cargo build --release --locked -p polkadot-parachain-bin -cp target/release/polkadot-parachain ~/local_bridge_testing/bin/polkadot-parachain-mint + +# checkout desired branch or use master: +# git checkout -b master --track origin/master + +cargo build --release --locked --bin polkadot-parachain +cp target/release/polkadot-parachain ~/local_bridge_testing/bin/polkadot-parachain +cp target/release/polkadot-parachain ~/local_bridge_testing/bin/polkadot-parachain-asset-hub + + + +# !!! READ HERE (TODO remove once all mentioned branches bellow are merged) +# The use case "moving assets over bridge" is not merged yet and is implemented in separate branches. +# So, if you want to try it, you need to checkout different branch and continue with these instructions there. + +# For Kusama/Polkadot local bridge testing: +# +# build BridgeHubs (polkadot-parachain) from branch: +# git checkout -b bridge-hub-kusama-polkadot --track origin/bridge-hub-kusama-polkadot +# cargo build --release --locked --bin polkadot-parachain +# cp target/release/polkadot-parachain ~/local_bridge_testing/bin/polkadot-parachain +# +# build AssetHubs (polkadot-parachain-asset-hub) from branch: +# git checkout -b bko-transfer-asset-via-bridge-pallet-xcm --track origin/bko-transfer-asset-via-bridge-pallet-xcm +# cargo build --release --locked --bin polkadot-parachain +# cp target/release/polkadot-parachain ~/local_bridge_testing/bin/polkadot-parachain-asset-hub + +# For Rococo/Wococo local bridge testing: +# +# build AssetHubs (polkadot-parachain-asset-hub) from branch: +# git checkout -b bko-transfer-asset-via-bridge-pallet-xcm-ro-wo --track origin/bko-transfer-asset-via-bridge-pallet-xcm-ro-wo +# cargo build --release --locked --bin polkadot-parachain +# cp target/release/polkadot-parachain ~/local_bridge_testing/bin/polkadot-parachain-asset-hub ``` -## How to test locally Rococo <-> Wococo bridge +## How to test local Rococo <-> Wococo bridge -### Run chains (Rococo + BridgeHub, Wococo + BridgeHub) with zombienet +### Run chains (Rococo + BridgeHub + AssetHub, Wococo + BridgeHub + AssetHub) with zombienet ``` -# Rococo + BridgeHubRococo + Rockmine (mirroring Kusama) +# Rococo + BridgeHubRococo + AssetHub for Rococo (mirroring Kusama) POLKADOT_BINARY_PATH=~/local_bridge_testing/bin/polkadot \ POLKADOT_PARACHAIN_BINARY_PATH=~/local_bridge_testing/bin/polkadot-parachain \ -POLKADOT_PARACHAIN_BINARY_PATH_FOR_ROCKMINE=~/local_bridge_testing/bin/polkadot-parachain-mint \ +POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_ROCOCO=~/local_bridge_testing/bin/polkadot-parachain-asset-hub \ ~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml ``` ``` -# Wococo + BridgeHubWococo + Wockmint (mirroring Polkadot) +# Wococo + BridgeHubWococo + AssetHub for Wococo (mirroring Polkadot) POLKADOT_BINARY_PATH=~/local_bridge_testing/bin/polkadot \ POLKADOT_PARACHAIN_BINARY_PATH=~/local_bridge_testing/bin/polkadot-parachain \ -POLKADOT_PARACHAIN_BINARY_PATH_FOR_WOCKMINT=~/local_bridge_testing/bin/polkadot-parachain-mint \ +POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_WOCOCO=~/local_bridge_testing/bin/polkadot-parachain-asset-hub \ ~/local_bridge_testing/bin/zombienet-linux --provider native spawn ./zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml ``` @@ -191,65 +211,26 @@ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \ - Pallet: **bridgeRococoParachain** - Keys: **bestParaHeads()** -### Send messages - -#### Local zombienet run - -1. allow bridge transfer on kusama/westend asset hubs (governance-like): - ``` - ./scripts/bridges_rococo_wococo.sh allow-transfers-local - ``` - -2. do (asset) transfer from kusama's asset hub to westend's asset hub: - ``` - ./scripts/bridges_rococo_wococo.sh transfer-asset-from-asset-hub-kusama-local - ``` - -3. do (ping) transfer from kusama's asset hub to westend's asset hub - ``` - ./scripts/bridges_rococo_wococo.sh ping-via-bridge-from-asset-hub-kusama-local - ``` +### Send messages - transfer asset over bridge -- open explorers: (see zombienets) - - Kusama Asset Hub (see events `xcmpQueue.XcmpMessageSent`, `bridgeTransfer.ReserveAssetsDeposited`, `bridgeTransfer.TransferInitiated`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9910#/explorer - - BridgeHubRococo (see `bridgeWococoMessages.MessageAccepted`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8943#/explorer - - BridgeHubWococo (see `bridgeRococoMessages.MessagesReceived`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8945#/explorer - - Westend Asset Hub (see `xcmpQueue.Success` for `transfer-asset` and `xcmpQueue.Fail` for `ping-via-bridge`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:9010#/explorer - - BridgeHubRococo (see `bridgeWococoMessages.MessagesDelivered`) https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8943#/explorer +TODO: see `# !!! READ HERE` above -#### Live Rockmine2 to Wockmint +## How to test live BridgeHubRococo/BridgeHubWococo +(here is still deployed older PoC from branch `origin/bko-transfer-asset-via-bridge`, which uses custom extrinsic, which is going to be replaced by `pallet_xcm` usage) - uses account seed on Live Rococo:Rockmine2 ``` cd - ./scripts/bridges_rococo_wococo.sh transfer-asset-from-asset-hub-rococo - or - ./scripts/bridges_rococo_wococo.sh ping-via-bridge-from-asset-hub-rococo ``` - open explorers: - Rockmine2 (see events `xcmpQueue.XcmpMessageSent`, `bridgeTransfer.ReserveAssetsDeposited`, `bridgeTransfer.TransferInitiated`) https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fws-rococo-rockmine2-collator-node-0.parity-testnet.parity.io#/explorer - BridgeHubRococo (see `bridgeWococoMessages.MessageAccepted`) https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-bridge-hub-rpc.polkadot.io#/explorer - BridgeHubWococo (see `bridgeRococoMessages.MessagesReceived`) https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fwococo-bridge-hub-rpc.polkadot.io#/explorer - - Wockmint (see `xcmpQueue.Success` for `transfer-asset` and `xcmpQueue.Fail` for `ping-via-bridge`) https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fws-wococo-wockmint-collator-node-0.parity-testnet.parity.io#/explorer + - Wockmint (see `xcmpQueue.Success` for `transfer-asset` and `xcmpQueue.Fail` for `ping-via-bridge`) https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fwococo-wockmint-rpc.polkadot.io#/explorer - BridgeHubRococo (see `bridgeWococoMessages.MessagesDelivered`) -## How to test local BridgeHubKusama -``` -cd -cargo build --release -p polkadot-parachain-bin - -# script expect to have pre-built polkadot binary on the path: ../polkadot/target/release/polkadot -# if using `kusama-local` / `polkadot-local`, build polkadot with `--features fast-runtime` -# BridgeHubKusama -zombienet-linux --provider native spawn ./zombienet/examples/bridge_hub_kusama_local_network.toml - -or - -# BridgeHubPolkadot -zombienet-linux --provider native spawn ./zombienet/examples/bridge_hub_polkadot_local_network.toml -``` +## How to test local BridgeHubKusama/BridgeHubPolkadot -## How to test local BridgeHubPolkadot -TODO: from master +TODO: see `# !!! READ HERE` above diff --git a/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml b/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml index 4e1260f9e41..80b398ac724 100644 --- a/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml +++ b/zombienet/bridge-hubs/bridge_hub_rococo_local_network.toml @@ -71,7 +71,7 @@ cumulus_based = true name = "rockmine-collator1" rpc_port = 9911 ws_port = 9910 - command = "{{POLKADOT_PARACHAIN_BINARY_PATH_FOR_ROCKMINE}}" + command = "{{POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_ROCOCO}}" args = [ "-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace", ] @@ -82,7 +82,7 @@ cumulus_based = true [[parachains.collators]] name = "rockmine-collator2" - command = "{{POLKADOT_PARACHAIN_BINARY_PATH_FOR_ROCKMINE}}" + command = "{{POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_ROCOCO}}" args = [ "-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace", ] diff --git a/zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml b/zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml index 7dcc8dd7232..9727b4a087f 100644 --- a/zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml +++ b/zombienet/bridge-hubs/bridge_hub_wococo_local_network.toml @@ -71,7 +71,7 @@ cumulus_based = true name = "wockmint-collator1" rpc_port = 9011 ws_port = 9010 - command = "{{POLKADOT_PARACHAIN_BINARY_PATH_FOR_WOCKMINT}}" + command = "{{POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_WOCOCO}}" args = [ "-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace", ] @@ -82,7 +82,7 @@ cumulus_based = true [[parachains.collators]] name = "wockmint-collator2" - command = "{{POLKADOT_PARACHAIN_BINARY_PATH_FOR_WOCKMINT}}" + command = "{{POLKADOT_PARACHAIN_BINARY_PATH_FOR_ASSET_HUB_WOCOCO}}" args = [ "-lparachain=debug,xcm=trace,runtime::bridge-transfer=trace", ] From 1d652af24a6f9fb1d97751b4560529bb8c83217d Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Mon, 24 Jul 2023 16:50:10 +0200 Subject: [PATCH 17/17] Build just `polkadot-parachain` binary for `build-short-benchmark` (#2928) --- scripts/ci/gitlab/pipeline/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/gitlab/pipeline/build.yml b/scripts/ci/gitlab/pipeline/build.yml index b200e61deb0..b47dd9fe30d 100644 --- a/scripts/ci/gitlab/pipeline/build.yml +++ b/scripts/ci/gitlab/pipeline/build.yml @@ -133,6 +133,6 @@ build-short-benchmark: - job: check-rustdoc artifacts: false script: - - cargo build --profile release --locked --features=runtime-benchmarks + - cargo build --profile release --locked --features=runtime-benchmarks --bin polkadot-parachain - mkdir -p ./artifacts - cp ./target/release/polkadot-parachain ./artifacts/