[cumulus] parachains-common testnet constants cleaning (#3134)

The `parachains-common` contains a lots of constants and type
definitions which are used for `polkadot-sdk`'s testnet runtimes and
also for `polkadot-fellows`'s production [SP
runtimes](https://github.com/polkadot-fellows/runtimes/tree/main/system-parachains/constants).
This PR cleans `parachains-common` module to contain only common and
generic functionality.

Testnet-specific constants have been moved to the separate module
dedicated just for testnets:
`polkadot-sdk/cumulus/parachains/runtimes/constants/`


Part of: https://github.com/paritytech/polkadot-sdk/issues/3054

---------

Co-authored-by: georgepisaltu <george.pisaltu@parity.io>
This commit is contained in:
Branislav Kontur
2024-01-31 01:08:52 +01:00
committed by GitHub
parent 5b7f24fca1
commit 4450b61571
76 changed files with 246 additions and 219 deletions
@@ -80,7 +80,8 @@ cumulus-primitives-core = { path = "../../../../primitives/core", default-featur
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false, features = ["rococo"] }
parachains-common = { path = "../../../common", default-features = false }
testnet-parachains-constants = { path = "../../constants", default-features = false, features = ["rococo"] }
assets-common = { path = "../common", default-features = false }
# Bridges
@@ -244,6 +245,7 @@ std = [
"sp-version/std",
"sp-weights/std",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
@@ -35,7 +35,6 @@ use assets_common::{
};
use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;
use cumulus_primitives_core::AggregateMessageOrigin;
use parachains_common::rococo::snowbridge::EthereumNetwork;
use sp_api::impl_runtime_apis;
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
use sp_runtime::{
@@ -44,6 +43,7 @@ use sp_runtime::{
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult, Permill,
};
use testnet_parachains_constants::rococo::snowbridge::EthereumNetwork;
use sp_std::prelude::*;
#[cfg(feature = "std")]
@@ -74,12 +74,12 @@ use pallet_nfts::PalletFeatures;
use parachains_common::{
impls::DealWithFees,
message_queue::{NarrowOriginToSibling, ParaIdToSibling},
rococo::{consensus::*, currency::*, fee::WeightToFee},
AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, BlockNumber, CollectionId, Hash,
Header, ItemId, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS,
NORMAL_DISPATCH_RATIO,
};
use sp_runtime::{Perbill, RuntimeDebug};
use testnet_parachains_constants::rococo::{consensus::*, currency::*, fee::WeightToFee};
use xcm_config::{
ForeignAssetsConvertedConcreteId, ForeignCreatorsSovereignAccountOf, GovernanceLocation,
PoolAssetsConvertedConcreteId, TokenLocation, TokenLocationV3,
@@ -1721,9 +1721,9 @@ fn ensure_key_ss58() {
mod tests {
use super::*;
use crate::{CENTS, MILLICENTS};
use parachains_common::rococo::fee;
use sp_runtime::traits::Zero;
use sp_weights::WeightToFee;
use testnet_parachains_constants::rococo::fee;
/// We can fit at least 1000 transfers in a block.
#[test]
@@ -21,7 +21,6 @@ use super::{
XcmpQueue,
};
use assets_common::{
local_and_foreign_assets::MatchesLocalAndForeignAssetsLocation,
matching::{FromNetwork, FromSiblingParachain, IsForeignConcreteAsset},
TrustBackedAssetsAsLocation,
};
@@ -36,7 +35,6 @@ use frame_system::EnsureRoot;
use pallet_xcm::XcmPassthrough;
use parachains_common::{
impls::ToStakingPot,
rococo::snowbridge::EthereumNetwork,
xcm_config::{
AllSiblingSystemParachains, AssetFeeAsExistentialDepositMultiplier,
ConcreteAssetFromSystem, ParentRelayOrSiblingParachains, RelayOrOtherSystemParachains,
@@ -47,6 +45,9 @@ use polkadot_parachain_primitives::primitives::Sibling;
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
use snowbridge_router_primitives::inbound::GlobalConsensusEthereumConvertsFor;
use sp_runtime::traits::{AccountIdConversion, ConvertInto};
use testnet_parachains_constants::rococo::snowbridge::{
EthereumNetwork, INBOUND_QUEUE_PALLET_INDEX,
};
use xcm::latest::prelude::*;
#[allow(deprecated)]
use xcm_builder::CurrencyAdapter;
@@ -229,30 +230,6 @@ pub type AssetTransactors = (
UniquesTransactor,
);
/// Simple `Location` matcher for Local and Foreign asset `Location`.
pub struct LocalAndForeignAssetsLocationMatcher;
impl MatchesLocalAndForeignAssetsLocation<xcm::v3::Location>
for LocalAndForeignAssetsLocationMatcher
{
fn is_local(location: &xcm::v3::Location) -> bool {
use assets_common::fungible_conversion::MatchesLocation;
let latest_location: Location =
if let Ok(location) = (*location).try_into() { location } else { return false };
TrustBackedAssetsConvertedConcreteId::contains(&latest_location)
}
fn is_foreign(location: &xcm::v3::Location) -> bool {
use assets_common::fungible_conversion::MatchesLocation;
let latest_location: Location =
if let Ok(location) = (*location).try_into() { location } else { return false };
ForeignAssetsConvertedConcreteId::contains(&latest_location)
}
}
impl Contains<xcm::v3::Location> for LocalAndForeignAssetsLocationMatcher {
fn contains(location: &xcm::v3::Location) -> 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.
@@ -875,7 +852,7 @@ pub mod bridging {
1,
[
Parachain(SiblingBridgeHubParaId::get()),
PalletInstance(parachains_common::rococo::snowbridge::INBOUND_QUEUE_PALLET_INDEX)
PalletInstance(INBOUND_QUEUE_PALLET_INDEX)
]
);
@@ -46,13 +46,13 @@ use frame_support::{
},
weights::{Weight, WeightToFee as WeightToFeeT},
};
use parachains_common::{
rococo::{consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, currency::UNITS, fee::WeightToFee},
AccountId, AssetIdForTrustBackedAssets, AuraId, Balance,
};
use parachains_common::{AccountId, AssetIdForTrustBackedAssets, AuraId, Balance};
use sp_consensus_aura::SlotDuration;
use sp_runtime::traits::MaybeEquivalence;
use std::convert::Into;
use testnet_parachains_constants::rococo::{
consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, currency::UNITS, fee::WeightToFee,
};
use xcm::latest::prelude::{Assets as XcmAssets, *};
use xcm_builder::V4V3LocationConverter;
use xcm_executor::traits::{JustTry, WeightTrader};
@@ -77,7 +77,8 @@ cumulus-primitives-core = { path = "../../../../primitives/core", default-featur
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false, features = ["westend"] }
parachains-common = { path = "../../../common", default-features = false }
testnet-parachains-constants = { path = "../../constants", default-features = false, features = ["westend"] }
assets-common = { path = "../common", default-features = false }
# Bridges
@@ -226,6 +227,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"westend-runtime-constants/std",
"xcm-builder/std",
"xcm-executor/std",
@@ -56,12 +56,9 @@ use pallet_asset_conversion_tx_payment::AssetConversionAdapter;
use pallet_nfts::{DestroyWitness, PalletFeatures};
use pallet_xcm::EnsureXcm;
use parachains_common::{
impls::DealWithFees,
message_queue::*,
westend::{consensus::*, currency::*, fee::WeightToFee},
AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, BlockNumber, CollectionId, Hash,
Header, ItemId, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS,
MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
impls::DealWithFees, message_queue::*, AccountId, AssetIdForTrustBackedAssets, AuraId, Balance,
BlockNumber, CollectionId, Hash, Header, ItemId, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO,
DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
};
use sp_api::impl_runtime_apis;
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
@@ -75,6 +72,7 @@ use sp_std::prelude::*;
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
use testnet_parachains_constants::westend::{consensus::*, currency::*, fee::WeightToFee};
use xcm_config::{
ForeignAssetsConvertedConcreteId, PoolAssetsConvertedConcreteId,
TrustBackedAssetsConvertedConcreteId, TrustBackedAssetsPalletLocationV3, WestendLocation,
@@ -21,7 +21,6 @@ use super::{
XcmpQueue,
};
use assets_common::{
local_and_foreign_assets::MatchesLocalAndForeignAssetsLocation,
matching::{FromSiblingParachain, IsForeignConcreteAsset},
TrustBackedAssetsAsLocation,
};
@@ -224,31 +223,6 @@ pub type AssetTransactors = (
UniquesTransactor,
);
/// Simple `Location` matcher for Local and Foreign asset `Location`.
pub struct LocalAndForeignAssetsLocationMatcher;
impl MatchesLocalAndForeignAssetsLocation<xcm::v3::Location>
for LocalAndForeignAssetsLocationMatcher
{
fn is_local(location: &xcm::v3::Location) -> bool {
use assets_common::fungible_conversion::MatchesLocation;
let latest_location: Location =
if let Ok(location) = (*location).try_into() { location } else { return false };
TrustBackedAssetsConvertedConcreteId::contains(&latest_location)
}
fn is_foreign(location: &xcm::v3::Location) -> bool {
use assets_common::fungible_conversion::MatchesLocation;
let latest_location: Location =
if let Ok(location) = (*location).try_into() { location } else { return false };
ForeignAssetsConvertedConcreteId::contains(&latest_location)
}
}
impl Contains<xcm::v3::Location> for LocalAndForeignAssetsLocationMatcher {
fn contains(location: &xcm::v3::Location) -> 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.
@@ -47,13 +47,13 @@ use frame_support::{
},
weights::{Weight, WeightToFee as WeightToFeeT},
};
use parachains_common::{
westend::{consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, currency::UNITS, fee::WeightToFee},
AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, SLOT_DURATION,
};
use parachains_common::{AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, SLOT_DURATION};
use sp_consensus_aura::SlotDuration;
use sp_runtime::traits::MaybeEquivalence;
use std::convert::Into;
use testnet_parachains_constants::westend::{
consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, currency::UNITS, fee::WeightToFee,
};
use xcm::latest::prelude::{Assets as XcmAssets, *};
use xcm_builder::V4V3LocationConverter;
use xcm_executor::traits::{JustTry, WeightTrader};
@@ -52,8 +52,3 @@ where
}
}
}
pub trait MatchesLocalAndForeignAssetsLocation<L = Location> {
fn is_local(location: &L) -> bool;
fn is_foreign(location: &L) -> bool;
}
@@ -80,7 +80,8 @@ cumulus-primitives-core = { path = "../../../../primitives/core", default-featur
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false, features = ["rococo"] }
parachains-common = { path = "../../../common", default-features = false }
testnet-parachains-constants = { path = "../../constants", default-features = false, features = ["rococo"] }
# Bridges
bp-asset-hub-rococo = { path = "../../../../../bridges/primitives/chain-asset-hub-rococo", default-features = false }
@@ -212,7 +213,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
@@ -230,7 +230,8 @@ mod tests {
use bridge_runtime_common::{
assert_complete_bridge_types, integrity::check_message_lane_weights,
};
use parachains_common::{rococo, Balance};
use parachains_common::Balance;
use testnet_parachains_constants::rococo;
/// Every additional message in the message delivery transaction boosts its priority.
/// So the priority of transaction with `N+1` messages is larger than priority of
@@ -15,8 +15,8 @@
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
use crate::{xcm_config::UniversalLocation, Runtime};
use parachains_common::rococo::snowbridge::EthereumNetwork;
use snowbridge_router_primitives::outbound::EthereumBlobExporter;
use testnet_parachains_constants::rococo::snowbridge::EthereumNetwork;
/// Exports message to the Ethereum Gateway contract.
pub type SnowbridgeExporter = EthereumBlobExporter<
@@ -252,7 +252,8 @@ mod tests {
AssertCompleteBridgeConstants,
},
};
use parachains_common::{rococo, Balance};
use parachains_common::Balance;
use testnet_parachains_constants::rococo;
/// Every additional message in the message delivery transaction boosts its priority.
/// So the priority of transaction with `N+1` messages is larger than priority of
@@ -93,10 +93,11 @@ use xcm::latest::prelude::*;
use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight};
use parachains_common::{
impls::DealWithFees,
rococo::{consensus::*, currency::*, fee::WeightToFee},
AccountId, Balance, BlockNumber, Hash, Header, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO,
HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
impls::DealWithFees, AccountId, Balance, BlockNumber, Hash, Header, Nonce, Signature,
AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
};
use testnet_parachains_constants::rococo::{
consensus::*, currency::*, fee::WeightToFee, snowbridge::INBOUND_QUEUE_PALLET_INDEX,
};
use polkadot_runtime_common::prod_or_fast;
@@ -497,7 +498,6 @@ parameter_types! {
parameter_types! {
pub const CreateAssetCall: [u8;2] = [53, 0];
pub const CreateAssetDeposit: u128 = (UNITS / 10) + EXISTENTIAL_DEPOSIT;
pub const InboundQueuePalletInstance: u8 = parachains_common::rococo::snowbridge::INBOUND_QUEUE_PALLET_INDEX;
pub Parameters: PricingParameters<u128> = PricingParameters {
exchange_rate: FixedU128::from_rational(1, 400),
fee_per_gas: gwei(20),
@@ -558,7 +558,7 @@ impl snowbridge_pallet_inbound_queue::Config for Runtime {
type MessageConverter = MessageToXcm<
CreateAssetCall,
CreateAssetDeposit,
InboundQueuePalletInstance,
ConstU8<INBOUND_QUEUE_PALLET_INDEX>,
AccountId,
Balance,
>;
@@ -40,7 +40,6 @@ use frame_system::EnsureRoot;
use pallet_xcm::XcmPassthrough;
use parachains_common::{
impls::ToStakingPot,
rococo::snowbridge::EthereumNetwork,
xcm_config::{
AllSiblingSystemParachains, ConcreteAssetFromSystem, ParentRelayOrSiblingParachains,
RelayOrOtherSystemParachains,
@@ -53,6 +52,7 @@ use snowbridge_runtime_common::XcmExportFeeToSibling;
use sp_core::Get;
use sp_runtime::traits::AccountIdConversion;
use sp_std::marker::PhantomData;
use testnet_parachains_constants::rococo::snowbridge::EthereumNetwork;
use xcm::latest::prelude::*;
#[allow(deprecated)]
use xcm_builder::{
@@ -27,10 +27,7 @@ use bridge_hub_rococo_runtime::{
use bridge_hub_test_utils::SlotDurations;
use codec::{Decode, Encode};
use frame_support::{dispatch::GetDispatchInfo, parameter_types, traits::ConstU8};
use parachains_common::{
rococo::{consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, fee::WeightToFee},
AccountId, AuraId, Balance, SLOT_DURATION,
};
use parachains_common::{AccountId, AuraId, Balance, SLOT_DURATION};
use snowbridge_core::ChannelId;
use sp_consensus_aura::SlotDuration;
use sp_core::H160;
@@ -39,6 +36,9 @@ use sp_runtime::{
generic::{Era, SignedPayload},
AccountId32,
};
use testnet_parachains_constants::rococo::{
consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, fee::WeightToFee,
};
use xcm::latest::prelude::*;
parameter_types! {
@@ -72,7 +72,8 @@ cumulus-primitives-core = { path = "../../../../primitives/core", default-featur
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false, features = ["westend"] }
parachains-common = { path = "../../../common", default-features = false }
testnet-parachains-constants = { path = "../../constants", default-features = false, features = ["westend"] }
# Bridges
bp-asset-hub-rococo = { path = "../../../../../bridges/primitives/chain-asset-hub-rococo", default-features = false }
@@ -173,6 +174,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"westend-runtime-constants/std",
"xcm-builder/std",
"xcm-executor/std",
@@ -287,7 +287,8 @@ mod tests {
AssertCompleteBridgeConstants,
},
};
use parachains_common::{westend, Balance};
use parachains_common::Balance;
use testnet_parachains_constants::westend;
/// Every additional message in the message delivery transaction boosts its priority.
/// So the priority of transaction with `N+1` messages is larger than priority of
@@ -82,11 +82,10 @@ use xcm::latest::prelude::*;
use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight};
use parachains_common::{
impls::DealWithFees,
westend::{consensus::*, currency::*, fee::WeightToFee},
AccountId, Balance, BlockNumber, Hash, Header, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO,
HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
impls::DealWithFees, AccountId, Balance, BlockNumber, Hash, Header, Nonce, Signature,
AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
};
use testnet_parachains_constants::westend::{consensus::*, currency::*, fee::WeightToFee};
/// The address format for describing accounts.
pub type Address = MultiAddress<AccountId, ()>;
@@ -33,16 +33,16 @@ use bridge_to_rococo_config::{
};
use codec::{Decode, Encode};
use frame_support::{dispatch::GetDispatchInfo, parameter_types, traits::ConstU8};
use parachains_common::{
westend::{consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, fee::WeightToFee},
AccountId, AuraId, Balance, SLOT_DURATION,
};
use parachains_common::{AccountId, AuraId, Balance, SLOT_DURATION};
use sp_consensus_aura::SlotDuration;
use sp_keyring::AccountKeyring::Alice;
use sp_runtime::{
generic::{Era, SignedPayload},
AccountId32,
};
use testnet_parachains_constants::westend::{
consensus::RELAY_CHAIN_SLOT_DURATION_MILLIS, fee::WeightToFee,
};
use xcm::latest::prelude::*;
// Para id of sibling chain used in tests.
@@ -79,7 +79,8 @@ cumulus-primitives-utility = { path = "../../../../primitives/utility", default-
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
pallet-collective-content = { path = "../../../pallets/collective-content", default-features = false }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false, features = ["westend"] }
parachains-common = { path = "../../../common", default-features = false }
testnet-parachains-constants = { path = "../../constants", default-features = false, features = ["westend"] }
[build-dependencies]
substrate-wasm-builder = { path = "../../../../../substrate/utils/wasm-builder", optional = true }
@@ -222,6 +223,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"westend-runtime-constants/std",
"xcm-builder/std",
"xcm-executor/std",
@@ -38,16 +38,14 @@ pub use origins::{
};
use pallet_ranked_collective::EnsureOfRank;
use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
use parachains_common::{
impls::ToParentTreasury,
westend::{account, currency::GRAND},
};
use parachains_common::impls::ToParentTreasury;
use polkadot_runtime_common::impls::{
LocatableAssetConverter, VersionedLocatableAsset, VersionedLocationConverter,
};
use sp_arithmetic::Permill;
use sp_core::{ConstU128, ConstU32};
use sp_runtime::traits::{ConstU16, ConvertToValue, IdentityLookup, Replace, TakeFirst};
use testnet_parachains_constants::westend::{account, currency::GRAND};
use westend_runtime_constants::time::HOURS;
use xcm::prelude::*;
use xcm_builder::{AliasesIntoAccountId32, PayOverXcm};
@@ -55,7 +53,7 @@ use xcm_builder::{AliasesIntoAccountId32, PayOverXcm};
#[cfg(feature = "runtime-benchmarks")]
use crate::impls::benchmarks::{OpenHrmpChannel, PayWithEnsure};
#[cfg(feature = "runtime-benchmarks")]
use parachains_common::westend::currency::DOLLARS;
use testnet_parachains_constants::westend::currency::DOLLARS;
/// The Fellowship members' ranks.
pub mod ranks {
@@ -83,12 +83,14 @@ pub use parachains_common as common;
use parachains_common::{
impls::{DealWithFees, ToParentTreasury},
message_queue::*,
westend::{account::*, consensus::*, currency::*, fee::WeightToFee},
AccountId, AuraId, Balance, BlockNumber, Hash, Header, Nonce, Signature,
AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, MINUTES, NORMAL_DISPATCH_RATIO,
SLOT_DURATION,
};
use sp_runtime::RuntimeDebug;
use testnet_parachains_constants::westend::{
account::*, consensus::*, currency::*, fee::WeightToFee,
};
use xcm_config::{
GovernanceLocation, LocationToAccountId, TreasurerBodyId, XcmOriginToTransactDispatchOrigin,
};
@@ -0,0 +1,41 @@
[package]
name = "testnet-parachains-constants"
version = "1.0.0"
authors.workspace = true
edition.workspace = true
description = "Common constants for Testnet Parachains runtimes"
license = "Apache-2.0"
[lints]
workspace = true
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
smallvec = "1.11.0"
# Substrate
frame-support = { path = "../../../../substrate/frame/support", default-features = false }
sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
# Polkadot
polkadot-core-primitives = { path = "../../../../polkadot/core-primitives", default-features = false }
rococo-runtime-constants = { path = "../../../../polkadot/runtime/rococo/constants", default-features = false, optional = true }
westend-runtime-constants = { path = "../../../../polkadot/runtime/westend/constants", default-features = false, optional = true }
xcm = { package = "staging-xcm", path = "../../../../polkadot/xcm", default-features = false }
[features]
default = ["std"]
std = [
"frame-support/std",
"polkadot-core-primitives/std",
"rococo-runtime-constants?/std",
"sp-runtime/std",
"westend-runtime-constants?/std",
"xcm/std",
]
# Test runtimes specific features.
rococo = ["rococo-runtime-constants"]
westend = ["westend-runtime-constants"]
@@ -0,0 +1,21 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(feature = "rococo")]
pub mod rococo;
#[cfg(feature = "westend")]
pub mod westend;
@@ -0,0 +1,135 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
pub mod currency {
use polkadot_core_primitives::Balance;
use rococo_runtime_constants as constants;
/// The existential deposit. Set to 1/10 of its parent Relay Chain (v9010).
pub const EXISTENTIAL_DEPOSIT: Balance = constants::currency::EXISTENTIAL_DEPOSIT / 10;
pub const UNITS: Balance = constants::currency::UNITS;
pub const CENTS: Balance = constants::currency::CENTS;
pub const MILLICENTS: Balance = constants::currency::MILLICENTS;
pub const fn deposit(items: u32, bytes: u32) -> Balance {
// map to 1/100 of what the rococo relay chain charges
constants::currency::deposit(items, bytes) / 100
}
}
pub mod fee {
use frame_support::{
pallet_prelude::Weight,
weights::{
constants::ExtrinsicBaseWeight, FeePolynomial, WeightToFeeCoefficient,
WeightToFeeCoefficients, WeightToFeePolynomial,
},
};
use polkadot_core_primitives::Balance;
use smallvec::smallvec;
pub use sp_runtime::Perbill;
/// The block saturation level. Fees will be updates based on this value.
pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25);
/// Handles converting a weight scalar to a fee value, based on the scale and granularity of the
/// node's balance type.
///
/// This should typically create a mapping between the following ranges:
/// - `[0, MAXIMUM_BLOCK_WEIGHT]`
/// - `[Balance::min, Balance::max]`
///
/// Yet, it can be used for any other sort of change to weight-fee. Some examples being:
/// - Setting it to `0` will essentially disable the weight fee.
/// - Setting it to `1` will cause the literal `#[weight = x]` values to be charged.
pub struct WeightToFee;
impl frame_support::weights::WeightToFee for WeightToFee {
type Balance = Balance;
fn weight_to_fee(weight: &Weight) -> Self::Balance {
let time_poly: FeePolynomial<Balance> = RefTimeToFee::polynomial().into();
let proof_poly: FeePolynomial<Balance> = ProofSizeToFee::polynomial().into();
// Take the maximum instead of the sum to charge by the more scarce resource.
time_poly.eval(weight.ref_time()).max(proof_poly.eval(weight.proof_size()))
}
}
/// Maps the reference time component of `Weight` to a fee.
pub struct RefTimeToFee;
impl WeightToFeePolynomial for RefTimeToFee {
type Balance = Balance;
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
// In Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT:
// The standard system parachain configuration is 1/10 of that, as in 1/100 CENT.
let p = super::currency::CENTS;
let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time());
smallvec![WeightToFeeCoefficient {
degree: 1,
negative: false,
coeff_frac: Perbill::from_rational(p % q, q),
coeff_integer: p / q,
}]
}
}
/// Maps the proof size component of `Weight` to a fee.
pub struct ProofSizeToFee;
impl WeightToFeePolynomial for ProofSizeToFee {
type Balance = Balance;
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
// Map 10kb proof to 1 CENT.
let p = super::currency::CENTS;
let q = 10_000;
smallvec![WeightToFeeCoefficient {
degree: 1,
negative: false,
coeff_frac: Perbill::from_rational(p % q, q),
coeff_integer: p / q,
}]
}
}
}
/// Consensus-related.
pub mod consensus {
/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included
/// into the relay chain.
pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1;
/// How many parachain blocks are processed by the relay chain per parent. Limits the
/// number of blocks authored per slot.
pub const BLOCK_PROCESSING_VELOCITY: u32 = 1;
/// Relay chain slot duration, in milliseconds.
pub const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000;
}
pub mod snowbridge {
use frame_support::parameter_types;
use xcm::opaque::lts::NetworkId;
/// The pallet index of the Ethereum inbound queue pallet in the bridge hub runtime.
pub const INBOUND_QUEUE_PALLET_INDEX: u8 = 80;
parameter_types! {
/// Network and location for the Ethereum chain. On Rococo, the Ethereum chain bridged
/// to is the Sepolia Ethereum testnet, with chain ID 11155111.
/// <https://chainlist.org/chain/11155111>
/// <https://ethereum.org/en/developers/docs/apis/json-rpc/#net_version>
pub EthereumNetwork: NetworkId = NetworkId::Ethereum { chain_id: 11155111 };
}
}
@@ -0,0 +1,142 @@
// 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.
/// Universally recognized accounts.
pub mod account {
use frame_support::PalletId;
/// Westend treasury pallet id, used to convert into AccountId - in Westend as a destination for
/// slashed funds.
pub const WESTEND_TREASURY_PALLET_ID: PalletId = PalletId(*b"py/trsry");
/// Alliance pallet ID - used as a temporary place to deposit a slashed imbalance before the
/// teleport to the Treasury.
pub const ALLIANCE_PALLET_ID: PalletId = PalletId(*b"py/allia");
/// Referenda pallet ID - used as a temporary place to deposit a slashed imbalance before the
/// teleport to the Treasury.
pub const REFERENDA_PALLET_ID: PalletId = PalletId(*b"py/refer");
/// Ambassador Referenda pallet ID - used as a temporary place to deposit a slashed imbalance
/// before the teleport to the Treasury.
pub const AMBASSADOR_REFERENDA_PALLET_ID: PalletId = PalletId(*b"py/amref");
/// Fellowship treasury pallet ID.
pub const FELLOWSHIP_TREASURY_PALLET_ID: PalletId = PalletId(*b"py/feltr");
}
pub mod currency {
use polkadot_core_primitives::Balance;
use westend_runtime_constants as constants;
/// The existential deposit. Set to 1/10 of its parent Relay Chain.
pub const EXISTENTIAL_DEPOSIT: Balance = constants::currency::EXISTENTIAL_DEPOSIT / 10;
pub const UNITS: Balance = constants::currency::UNITS;
pub const DOLLARS: Balance = UNITS; // 1_000_000_000_000
pub const CENTS: Balance = constants::currency::CENTS;
pub const MILLICENTS: Balance = constants::currency::MILLICENTS;
pub const GRAND: Balance = constants::currency::GRAND;
pub const fn deposit(items: u32, bytes: u32) -> Balance {
// 1/100 of Westend testnet
constants::currency::deposit(items, bytes) / 100
}
}
/// Fee-related.
pub mod fee {
use frame_support::{
pallet_prelude::Weight,
weights::{
constants::ExtrinsicBaseWeight, FeePolynomial, WeightToFeeCoefficient,
WeightToFeeCoefficients, WeightToFeePolynomial,
},
};
use polkadot_core_primitives::Balance;
use smallvec::smallvec;
pub use sp_runtime::Perbill;
/// The block saturation level. Fees will be updated based on this value.
pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25);
/// Handles converting a weight scalar to a fee value, based on the scale and granularity of the
/// node's balance type.
///
/// This should typically create a mapping between the following ranges:
/// - [0, MAXIMUM_BLOCK_WEIGHT]
/// - [Balance::min, Balance::max]
///
/// Yet, it can be used for any other sort of change to weight-fee. Some examples being:
/// - Setting it to `0` will essentially disable the weight fee.
/// - Setting it to `1` will cause the literal `#[weight = x]` values to be charged.
pub struct WeightToFee;
impl frame_support::weights::WeightToFee for WeightToFee {
type Balance = Balance;
fn weight_to_fee(weight: &Weight) -> Self::Balance {
let time_poly: FeePolynomial<Balance> = RefTimeToFee::polynomial().into();
let proof_poly: FeePolynomial<Balance> = ProofSizeToFee::polynomial().into();
// Take the maximum instead of the sum to charge by the more scarce resource.
time_poly.eval(weight.ref_time()).max(proof_poly.eval(weight.proof_size()))
}
}
/// Maps the reference time component of `Weight` to a fee.
pub struct RefTimeToFee;
impl WeightToFeePolynomial for RefTimeToFee {
type Balance = Balance;
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
// In Westend, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT:
// The standard system parachain configuration is 1/10 of that, as in 1/100 CENT.
let p = super::currency::CENTS;
let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time());
smallvec![WeightToFeeCoefficient {
degree: 1,
negative: false,
coeff_frac: Perbill::from_rational(p % q, q),
coeff_integer: p / q,
}]
}
}
/// Maps the proof size component of `Weight` to a fee.
pub struct ProofSizeToFee;
impl WeightToFeePolynomial for ProofSizeToFee {
type Balance = Balance;
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
// Map 10kb proof to 1 CENT.
let p = super::currency::CENTS;
let q = 10_000;
smallvec![WeightToFeeCoefficient {
degree: 1,
negative: false,
coeff_frac: Perbill::from_rational(p % q, q),
coeff_integer: p / q,
}]
}
}
}
/// Consensus-related.
pub mod consensus {
/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included into the
/// relay chain.
pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1;
/// How many parachain blocks are processed by the relay chain per parent. Limits the number of
/// blocks authored per slot.
pub const BLOCK_PROCESSING_VELOCITY: u32 = 1;
/// Relay chain slot duration, in milliseconds.
pub const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000;
}
@@ -75,7 +75,8 @@ cumulus-primitives-core = { path = "../../../../primitives/core", default-featur
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false, features = ["rococo"] }
parachains-common = { path = "../../../common", default-features = false }
testnet-parachains-constants = { path = "../../constants", default-features = false, features = ["rococo"] }
[features]
default = ["std"]
@@ -131,6 +132,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
@@ -26,7 +26,7 @@ use pallet_contracts::{
};
use sp_runtime::Perbill;
pub use parachains_common::rococo::currency::deposit;
use testnet_parachains_constants::rococo::currency::deposit;
// Prints debug output of the `contracts` pallet to stdout if the node is
// started with `-lruntime::contracts=debug`.
@@ -57,13 +57,12 @@ use frame_support::{
use frame_system::limits::{BlockLength, BlockWeights};
pub use parachains_common as common;
use parachains_common::{
impls::DealWithFees,
message_queue::*,
rococo::{consensus::*, currency::*, fee::WeightToFee},
AccountId, BlockNumber, Hash, Header, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO,
MAXIMUM_BLOCK_WEIGHT, MINUTES, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
impls::DealWithFees, message_queue::*, AccountId, BlockNumber, Hash, Header, Nonce, Signature,
AVERAGE_ON_INITIALIZE_RATIO, MAXIMUM_BLOCK_WEIGHT, MINUTES, NORMAL_DISPATCH_RATIO,
SLOT_DURATION,
};
pub use parachains_common::{AuraId, Balance};
use testnet_parachains_constants::rococo::{consensus::*, currency::*, fee::WeightToFee};
use xcm_config::CollatorSelectionUpdateOrigin;
#[cfg(any(feature = "std", test))]
@@ -17,7 +17,6 @@ use super::{
AccountId, AllPalletsWithSystem, Balances, ParachainInfo, ParachainSystem, PolkadotXcm,
Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, TransactionByteFee, WeightToFee, XcmpQueue,
};
use crate::common::rococo::currency::CENTS;
use cumulus_primitives_core::AggregateMessageOrigin;
use frame_support::{
parameter_types,
@@ -36,6 +35,7 @@ use parachains_common::{
use polkadot_parachain_primitives::primitives::Sibling;
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
use sp_runtime::traits::AccountIdConversion;
use testnet_parachains_constants::rococo::currency::CENTS;
use xcm::latest::prelude::*;
#[allow(deprecated)]
use xcm_builder::CurrencyAdapter;
@@ -74,7 +74,8 @@ cumulus-primitives-core = { path = "../../../../primitives/core", default-featur
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false, features = ["rococo"] }
parachains-common = { path = "../../../common", default-features = false }
testnet-parachains-constants = { path = "../../constants", default-features = false, features = ["rococo"] }
[features]
default = ["std"]
@@ -132,6 +133,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
@@ -52,7 +52,6 @@ use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
use parachains_common::{
impls::DealWithFees,
message_queue::{NarrowOriginToSibling, ParaIdToSibling},
rococo::{consensus::*, currency::*, fee::WeightToFee},
AccountId, AuraId, Balance, BlockNumber, Hash, Header, Nonce, Signature,
AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
};
@@ -71,6 +70,7 @@ use sp_std::prelude::*;
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
use testnet_parachains_constants::rococo::{consensus::*, currency::*, fee::WeightToFee};
use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight};
use xcm::latest::prelude::*;
use xcm_config::{
@@ -73,7 +73,8 @@ cumulus-primitives-core = { path = "../../../../primitives/core", default-featur
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false, features = ["westend"] }
parachains-common = { path = "../../../common", default-features = false }
testnet-parachains-constants = { path = "../../constants", default-features = false, features = ["westend"] }
[features]
default = ["std"]
@@ -129,6 +130,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"westend-runtime-constants/std",
"xcm-builder/std",
"xcm-executor/std",
@@ -43,7 +43,6 @@ use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
use parachains_common::{
impls::DealWithFees,
message_queue::{NarrowOriginToSibling, ParaIdToSibling},
westend::{consensus::*, currency::*, fee::WeightToFee},
AccountId, AuraId, Balance, BlockNumber, Hash, Header, Nonce, Signature,
AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
};
@@ -62,6 +61,7 @@ use sp_std::prelude::*;
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
use testnet_parachains_constants::westend::{consensus::*, currency::*, fee::WeightToFee};
use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight};
use xcm::latest::prelude::*;
use xcm_config::{
@@ -53,7 +53,8 @@ cumulus-primitives-aura = { path = "../../../../primitives/aura", default-featur
cumulus-primitives-core = { path = "../../../../primitives/core", default-features = false }
cumulus-primitives-timestamp = { path = "../../../../primitives/timestamp", default-features = false }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false, features = ["westend"] }
parachains-common = { path = "../../../common", default-features = false }
testnet-parachains-constants = { path = "../../constants", default-features = false, features = ["westend"] }
[build-dependencies]
substrate-wasm-builder = { path = "../../../../../substrate/utils/wasm-builder" }
@@ -112,6 +113,7 @@ std = [
"sp-storage/std",
"sp-transaction-pool/std",
"sp-version/std",
"testnet-parachains-constants/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
@@ -70,7 +70,8 @@ cumulus-primitives-core = { path = "../../../../primitives/core", default-featur
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false, features = ["rococo"] }
parachains-common = { path = "../../../common", default-features = false }
testnet-parachains-constants = { path = "../../constants", default-features = false, features = ["rococo"] }
[features]
default = ["std"]
@@ -127,6 +128,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
@@ -43,7 +43,6 @@ use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
use parachains_common::{
impls::DealWithFees,
message_queue::{NarrowOriginToSibling, ParaIdToSibling},
rococo::{consensus::*, currency::*, fee::WeightToFee},
AccountId, Balance, BlockNumber, Hash, Header, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO,
HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
};
@@ -64,6 +63,7 @@ use sp_std::prelude::*;
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
use testnet_parachains_constants::rococo::{consensus::*, currency::*, fee::WeightToFee};
use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight};
use xcm::latest::prelude::BodyId;
use xcm_config::{
@@ -70,7 +70,8 @@ cumulus-primitives-core = { path = "../../../../primitives/core", default-featur
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false, features = ["westend"] }
parachains-common = { path = "../../../common", default-features = false }
testnet-parachains-constants = { path = "../../constants", default-features = false, features = ["westend"] }
[features]
default = ["std"]
@@ -126,6 +127,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"westend-runtime-constants/std",
"xcm-builder/std",
"xcm-executor/std",
@@ -43,7 +43,6 @@ use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
use parachains_common::{
impls::DealWithFees,
message_queue::{NarrowOriginToSibling, ParaIdToSibling},
westend::{consensus::*, currency::*, fee::WeightToFee},
AccountId, Balance, BlockNumber, Hash, Header, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO,
HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
};
@@ -64,6 +63,7 @@ use sp_std::prelude::*;
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
use testnet_parachains_constants::westend::{consensus::*, currency::*, fee::WeightToFee};
use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight};
use xcm::latest::prelude::BodyId;
use xcm_config::{
@@ -76,7 +76,8 @@ cumulus-primitives-core = { path = "../../../../primitives/core", default-featur
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false, features = ["rococo"] }
parachains-common = { path = "../../../common", default-features = false }
testnet-parachains-constants = { path = "../../constants", default-features = false, features = ["rococo"] }
assets-common = { path = "../../assets/common", default-features = false }
[features]
@@ -132,6 +133,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
@@ -40,10 +40,10 @@ use frame_system::EnsureRoot;
use pallet_asset_tx_payment::HandleCredit;
use pallet_assets::Instance1;
use pallet_xcm::XcmPassthrough;
use parachains_common::rococo::snowbridge::EthereumNetwork;
use polkadot_parachain_primitives::primitives::Sibling;
use polkadot_runtime_common::impls::ToAuthor;
use sp_runtime::traits::Zero;
use testnet_parachains_constants::rococo::snowbridge::EthereumNetwork;
use xcm::latest::prelude::*;
#[allow(deprecated)]
use xcm_builder::{
@@ -57,7 +57,8 @@ cumulus-ping = { path = "../../../pallets/ping", default-features = false }
cumulus-primitives-aura = { path = "../../../../primitives/aura", default-features = false }
cumulus-primitives-core = { path = "../../../../primitives/core", default-features = false }
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
parachains-common = { path = "../../../common", default-features = false, features = ["rococo"] }
parachains-common = { path = "../../../common", default-features = false }
testnet-parachains-constants = { path = "../../constants", default-features = false, features = ["rococo"] }
parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false }
[build-dependencies]
@@ -107,6 +108,7 @@ std = [
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",