Skip to content

Commit

Permalink
[cumulus] parachains-common testnet constants cleaning (#3134)
Browse files Browse the repository at this point in the history
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: #3054

---------

Co-authored-by: georgepisaltu <george.pisaltu@parity.io>
  • Loading branch information
bkontur and georgepisaltu authored Jan 31, 2024
1 parent 5b7f24f commit 4450b61
Show file tree
Hide file tree
Showing 76 changed files with 246 additions and 219 deletions.
41 changes: 37 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions cumulus/parachains/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ targets = ["x86_64-unknown-linux-gnu"]
codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"], default-features = false }
log = { version = "0.4.19", default-features = false }
scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
smallvec = "1.11.0"

# Substrate
frame-support = { path = "../../../substrate/frame/support", default-features = false }
Expand All @@ -34,15 +33,10 @@ sp-std = { path = "../../../substrate/primitives/std", default-features = false

# Polkadot
pallet-xcm = { path = "../../../polkadot/xcm/pallet-xcm", default-features = false }
polkadot-core-primitives = { path = "../../../polkadot/core-primitives", default-features = false }
polkadot-primitives = { path = "../../../polkadot/primitives", default-features = false }
xcm = { package = "staging-xcm", path = "../../../polkadot/xcm", default-features = false }
xcm-executor = { package = "staging-xcm-executor", path = "../../../polkadot/xcm/xcm-executor", default-features = false }

# Polkadot - only for testnets
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 }

# Cumulus
pallet-collator-selection = { path = "../../pallets/collator-selection", default-features = false }
cumulus-primitives-core = { path = "../../primitives/core", default-features = false }
Expand Down Expand Up @@ -73,16 +67,13 @@ std = [
"pallet-message-queue/std",
"pallet-xcm/std",
"parachain-info/std",
"polkadot-core-primitives/std",
"polkadot-primitives/std",
"rococo-runtime-constants?/std",
"scale-info/std",
"sp-consensus-aura/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
"westend-runtime-constants?/std",
"xcm-executor/std",
"xcm/std",
]
Expand All @@ -102,7 +93,3 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
]

# Test runtimes specific features.
rococo = ["rococo-runtime-constants"]
westend = ["westend-runtime-constants"]
4 changes: 0 additions & 4 deletions cumulus/parachains/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@

pub mod impls;
pub mod message_queue;
#[cfg(feature = "rococo")]
pub mod rococo;
#[cfg(feature = "westend")]
pub mod westend;
pub mod xcm_config;
pub use constants::*;
pub use opaque::*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ workspace = true
sp-core = { path = "../../../../../../../../substrate/primitives/core", default-features = false }
frame-support = { path = "../../../../../../../../substrate/frame/support", default-features = false }

# Polakadot
parachains-common = { path = "../../../../../../../parachains/common" }

# Cumulus
parachains-common = { path = "../../../../../../../parachains/common" }
cumulus-primitives-core = { path = "../../../../../../../primitives/core", default-features = false }
emulated-integration-tests-common = { path = "../../../../common", default-features = false }
asset-hub-rococo-runtime = { path = "../../../../../../runtimes/assets/asset-hub-rococo" }
rococo-emulated-chain = { path = "../../../relays/rococo" }
testnet-parachains-constants = { path = "../../../../../../runtimes/constants", features = ["rococo"] }
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use emulated_integration_tests_common::{
use parachains_common::Balance;

pub const PARA_ID: u32 = 1000;
pub const ED: Balance = parachains_common::rococo::currency::EXISTENTIAL_DEPOSIT;
pub const ED: Balance = testnet_parachains_constants::rococo::currency::EXISTENTIAL_DEPOSIT;

pub fn genesis() -> Storage {
let genesis_config = asset_hub_rococo_runtime::RuntimeGenesisConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ workspace = true
sp-core = { path = "../../../../../../../../substrate/primitives/core", default-features = false }
frame-support = { path = "../../../../../../../../substrate/frame/support", default-features = false }

# Polakadot
parachains-common = { path = "../../../../../../../parachains/common" }

# Cumulus
parachains-common = { path = "../../../../../../../parachains/common" }
cumulus-primitives-core = { path = "../../../../../../../primitives/core", default-features = false }
emulated-integration-tests-common = { path = "../../../../common", default-features = false }
asset-hub-westend-runtime = { path = "../../../../../../runtimes/assets/asset-hub-westend" }
westend-emulated-chain = { path = "../../../relays/westend" }
testnet-parachains-constants = { path = "../../../../../../runtimes/constants", features = ["westend"] }
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use emulated_integration_tests_common::{
use parachains_common::Balance;

pub const PARA_ID: u32 = 1000;
pub const ED: Balance = parachains_common::westend::currency::EXISTENTIAL_DEPOSIT;
pub const ED: Balance = testnet_parachains_constants::westend::currency::EXISTENTIAL_DEPOSIT;

pub fn genesis() -> Storage {
let genesis_config = asset_hub_westend_runtime::RuntimeGenesisConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ workspace = true
sp-core = { path = "../../../../../../../../substrate/primitives/core", default-features = false }
frame-support = { path = "../../../../../../../../substrate/frame/support", default-features = false }

# Polakadot
parachains-common = { path = "../../../../../../../parachains/common" }

# Cumulus
parachains-common = { path = "../../../../../../../parachains/common" }
emulated-integration-tests-common = { path = "../../../../common", default-features = false }
bridge-hub-rococo-runtime = { path = "../../../../../../runtimes/bridge-hubs/bridge-hub-rococo" }
bridge-hub-common = { path = "../../../../../../runtimes/bridge-hubs/common", default-features = false }
testnet-parachains-constants = { path = "../../../../../../runtimes/constants", features = ["rococo"] }
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use parachains_common::Balance;

pub const ASSETHUB_PARA_ID: u32 = 1000;
pub const PARA_ID: u32 = 1013;
pub const ED: Balance = parachains_common::rococo::currency::EXISTENTIAL_DEPOSIT;
pub const ED: Balance = testnet_parachains_constants::rococo::currency::EXISTENTIAL_DEPOSIT;

pub fn genesis() -> Storage {
let genesis_config = bridge_hub_rococo_runtime::RuntimeGenesisConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ workspace = true
sp-core = { path = "../../../../../../../../substrate/primitives/core", default-features = false }
frame-support = { path = "../../../../../../../../substrate/frame/support", default-features = false }

# Polakadot
parachains-common = { path = "../../../../../../../parachains/common" }

# Cumulus
parachains-common = { path = "../../../../../../../parachains/common" }
emulated-integration-tests-common = { path = "../../../../common", default-features = false }
bridge-hub-westend-runtime = { path = "../../../../../../runtimes/bridge-hubs/bridge-hub-westend" }
bridge-hub-common = { path = "../../../../../../runtimes/bridge-hubs/common", default-features = false }
testnet-parachains-constants = { path = "../../../../../../runtimes/constants", features = ["westend"] }
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use emulated_integration_tests_common::{
use parachains_common::Balance;

pub const PARA_ID: u32 = 1002;
pub const ED: Balance = parachains_common::westend::currency::EXISTENTIAL_DEPOSIT;
pub const ED: Balance = testnet_parachains_constants::westend::currency::EXISTENTIAL_DEPOSIT;

pub fn genesis() -> Storage {
let genesis_config = bridge_hub_westend_runtime::RuntimeGenesisConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ workspace = true
sp-core = { path = "../../../../../../../../substrate/primitives/core", default-features = false }
frame-support = { path = "../../../../../../../../substrate/frame/support", default-features = false }

# Polakadot
parachains-common = { path = "../../../../../../../parachains/common" }

# Cumulus
parachains-common = { path = "../../../../../../../parachains/common" }
cumulus-primitives-core = { path = "../../../../../../../primitives/core", default-features = false }
emulated-integration-tests-common = { path = "../../../../common", default-features = false }
collectives-westend-runtime = { path = "../../../../../../runtimes/collectives/collectives-westend" }
testnet-parachains-constants = { path = "../../../../../../runtimes/constants", features = ["westend"] }
Loading

0 comments on commit 4450b61

Please sign in to comment.