[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"] }
# 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! {