diff --git a/Cargo.lock b/Cargo.lock index 826bb9398ae01538936a170c2f73d28ee7d4f67b..54a01f12f35c1a39f26acd8e53884250f6cd3d02 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14179,25 +14179,14 @@ dependencies = [ "asset-test-utils", "assets-common", "binary-merkle-tree", - "bp-asset-hub-rococo", - "bp-asset-hub-westend", - "bp-bridge-hub-cumulus", - "bp-bridge-hub-kusama", - "bp-bridge-hub-polkadot", - "bp-bridge-hub-rococo", - "bp-bridge-hub-westend", "bp-header-chain", - "bp-kusama", "bp-messages", "bp-parachains", "bp-polkadot", - "bp-polkadot-bulletin", "bp-polkadot-core", "bp-relayers", - "bp-rococo", "bp-runtime", "bp-test-utils", - "bp-westend", "bp-xcm-bridge-hub", "bp-xcm-bridge-hub-router", "bridge-hub-common", @@ -14408,7 +14397,6 @@ dependencies = [ "polkadot-service", "polkadot-statement-distribution", "polkadot-statement-table", - "rococo-runtime-constants", "sc-allocator", "sc-authority-discovery", "sc-basic-authorship", @@ -14552,7 +14540,6 @@ dependencies = [ "testnet-parachains-constants", "tracing-gum", "tracing-gum-proc-macro", - "westend-runtime-constants", "xcm-emulator", "xcm-procedural", "xcm-runtime-apis", diff --git a/bridges/chains/chain-asset-hub-rococo/Cargo.toml b/bridges/chains/chain-asset-hub-rococo/Cargo.toml index b765fbc57bb0aec2eb4544a01dd84c057ced16ef..363a869048aae4d875d68a8ca46e30756cbc799f 100644 --- a/bridges/chains/chain-asset-hub-rococo/Cargo.toml +++ b/bridges/chains/chain-asset-hub-rococo/Cargo.toml @@ -7,6 +7,9 @@ edition.workspace = true license = "GPL-3.0-or-later WITH Classpath-exception-2.0" repository.workspace = true +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [lints] workspace = true diff --git a/bridges/chains/chain-asset-hub-westend/Cargo.toml b/bridges/chains/chain-asset-hub-westend/Cargo.toml index ff89864fb2db4667d7929ef540ad4ec46cf2a36c..430d9b6116cfc7fba648b96b1de6ef379f3e38f3 100644 --- a/bridges/chains/chain-asset-hub-westend/Cargo.toml +++ b/bridges/chains/chain-asset-hub-westend/Cargo.toml @@ -7,6 +7,9 @@ edition.workspace = true license = "GPL-3.0-or-later WITH Classpath-exception-2.0" repository.workspace = true +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [lints] workspace = true diff --git a/bridges/chains/chain-bridge-hub-cumulus/Cargo.toml b/bridges/chains/chain-bridge-hub-cumulus/Cargo.toml index 5609398385f98b9d3731b196a057e939b1c099de..99ba721991ee90b04e708beb37dcca2f0aa5c96c 100644 --- a/bridges/chains/chain-bridge-hub-cumulus/Cargo.toml +++ b/bridges/chains/chain-bridge-hub-cumulus/Cargo.toml @@ -7,6 +7,9 @@ edition.workspace = true license = "GPL-3.0-or-later WITH Classpath-exception-2.0" repository.workspace = true +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [lints] workspace = true diff --git a/bridges/chains/chain-bridge-hub-kusama/Cargo.toml b/bridges/chains/chain-bridge-hub-kusama/Cargo.toml index 605643b0a4eb7e5d514edb1d4f1ad9db65a2c8ec..39f7b44daa5543b83108761d7acf5f72d5a8458f 100644 --- a/bridges/chains/chain-bridge-hub-kusama/Cargo.toml +++ b/bridges/chains/chain-bridge-hub-kusama/Cargo.toml @@ -7,6 +7,9 @@ edition.workspace = true license = "GPL-3.0-or-later WITH Classpath-exception-2.0" repository.workspace = true +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [lints] workspace = true diff --git a/bridges/chains/chain-bridge-hub-polkadot/Cargo.toml b/bridges/chains/chain-bridge-hub-polkadot/Cargo.toml index 97e36a19c748c0e5da990eda75bdbed9aa444e6f..3b0ac96e7cd367cd373cdaedcbeaf299af7debe0 100644 --- a/bridges/chains/chain-bridge-hub-polkadot/Cargo.toml +++ b/bridges/chains/chain-bridge-hub-polkadot/Cargo.toml @@ -7,6 +7,9 @@ edition.workspace = true license = "GPL-3.0-or-later WITH Classpath-exception-2.0" repository.workspace = true +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [lints] workspace = true diff --git a/bridges/chains/chain-bridge-hub-rococo/Cargo.toml b/bridges/chains/chain-bridge-hub-rococo/Cargo.toml index 5c918470322353c32556c3e5d381fb2ea713b2ab..66848ba0e2634b3b4e525f27013b04768204c749 100644 --- a/bridges/chains/chain-bridge-hub-rococo/Cargo.toml +++ b/bridges/chains/chain-bridge-hub-rococo/Cargo.toml @@ -7,6 +7,9 @@ edition.workspace = true license = "GPL-3.0-or-later WITH Classpath-exception-2.0" repository.workspace = true +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [lints] workspace = true diff --git a/bridges/chains/chain-bridge-hub-westend/Cargo.toml b/bridges/chains/chain-bridge-hub-westend/Cargo.toml index 0b429ab9a0bd9793a9129ed8483a608f71bfb44c..24a196c1d70d128c49ddb788a699fe6e22e6c359 100644 --- a/bridges/chains/chain-bridge-hub-westend/Cargo.toml +++ b/bridges/chains/chain-bridge-hub-westend/Cargo.toml @@ -7,6 +7,9 @@ edition.workspace = true license = "GPL-3.0-or-later WITH Classpath-exception-2.0" repository.workspace = true +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [lints] workspace = true diff --git a/bridges/chains/chain-kusama/Cargo.toml b/bridges/chains/chain-kusama/Cargo.toml index ec45c1eddce5d3b7be1f3a8ae9b83ca6332e7c28..aec4041f7d574243c07f3fefa66b8b6d4cb36057 100644 --- a/bridges/chains/chain-kusama/Cargo.toml +++ b/bridges/chains/chain-kusama/Cargo.toml @@ -7,6 +7,9 @@ edition.workspace = true license = "GPL-3.0-or-later WITH Classpath-exception-2.0" repository.workspace = true +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [lints] workspace = true diff --git a/bridges/chains/chain-polkadot-bulletin/Cargo.toml b/bridges/chains/chain-polkadot-bulletin/Cargo.toml index ea5f4d2e77591bd8840e869f9b3567df5d56fd56..aecf9314273686f03a25b0f4e5988eabb157dfe7 100644 --- a/bridges/chains/chain-polkadot-bulletin/Cargo.toml +++ b/bridges/chains/chain-polkadot-bulletin/Cargo.toml @@ -7,6 +7,9 @@ edition.workspace = true license = "GPL-3.0-or-later WITH Classpath-exception-2.0" repository.workspace = true +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [lints] workspace = true diff --git a/bridges/chains/chain-rococo/Cargo.toml b/bridges/chains/chain-rococo/Cargo.toml index 49a1a397ee096532cfc0b5d3a42cf14469f8ed46..8a99267691dc218d924fd0786e9fc45a5baa7f3c 100644 --- a/bridges/chains/chain-rococo/Cargo.toml +++ b/bridges/chains/chain-rococo/Cargo.toml @@ -7,6 +7,9 @@ edition.workspace = true license = "GPL-3.0-or-later WITH Classpath-exception-2.0" repository.workspace = true +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [lints] workspace = true diff --git a/bridges/chains/chain-westend/Cargo.toml b/bridges/chains/chain-westend/Cargo.toml index 5e27bc647bfc5f07d5ab029307ef6dcf67121fb3..cd6abe8abe6d69d5e5b9aa65d3ff7861c42d23cf 100644 --- a/bridges/chains/chain-westend/Cargo.toml +++ b/bridges/chains/chain-westend/Cargo.toml @@ -7,6 +7,9 @@ edition.workspace = true license = "GPL-3.0-or-later WITH Classpath-exception-2.0" repository.workspace = true +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [lints] workspace = true diff --git a/docs/contributor/CONTRIBUTING.md b/docs/contributor/CONTRIBUTING.md index 7d54b2681b41329c15ab4e3c25f37943ecf0d6a7..d8f956b82d2d807a75957c36801966ac58036898 100644 --- a/docs/contributor/CONTRIBUTING.md +++ b/docs/contributor/CONTRIBUTING.md @@ -82,6 +82,45 @@ Non "silent" PRs must come with documentation in the form of a `.prdoc` file. See more about `prdoc` [here](./prdoc.md) +## Crate Configuration `Cargo.toml` + +The Polkadot SDK uses many conventions when configuring a crate. Watch out for these things when you +are creating a new crate. + +### Is the Crate chain-specific? + +Chain-specific crates, for example +[`bp-bridge-hub-rococo`](https://github.com/paritytech/polkadot-sdk/blob/4014b9bf2bf8f74862f63e7114e5c78009529be5/bridges/chains/chain-bridge-hub-rococo/Cargo.toml#L10-L11) +, should not be released as part of the Polkadot-SDK umbrella crate. We have a custom metadata +attribute that is picked up by the [generate-umbrella.py](../../scripts/generate-umbrella.py) +script, that should be applied to all chain-specific crates like such: + +```toml +[package] +# Other stuff... + +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + +# Other stuff... +``` + +### Is the Crate a Test, Example or Fuzzer? + +Test or example crates, like +[`pallet-example-task`](https://github.com/paritytech/polkadot-sdk/blob/9b4acf27b869d7cbb07b03f0857763b8c8cc7566/substrate/frame/examples/tasks/Cargo.toml#L9) +, should not be released to crates.io. To ensure this, you must add `publish = false` to your +crate's `package` section: + +```toml +[package] +# Other stuff... + +publish = false + +# Other stuff... +``` + ## Helping out We use [labels](https://github.com/paritytech/polkadot-sdk/labels) to manage PRs and issues and communicate state of a diff --git a/polkadot/runtime/rococo/constants/Cargo.toml b/polkadot/runtime/rococo/constants/Cargo.toml index b67c36d71fd8721c583789a7a283868111afc037..1d0adac44af4dcbb099182ebfbc1a4a1333f8422 100644 --- a/polkadot/runtime/rococo/constants/Cargo.toml +++ b/polkadot/runtime/rococo/constants/Cargo.toml @@ -6,6 +6,9 @@ authors.workspace = true edition.workspace = true license.workspace = true +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [lints] workspace = true diff --git a/polkadot/runtime/westend/constants/Cargo.toml b/polkadot/runtime/westend/constants/Cargo.toml index f9b99ea5284d3322b6e0bf100f8314000a4b5bce..27d5b19b8e77113a8f4ea5f14bfb701364308f07 100644 --- a/polkadot/runtime/westend/constants/Cargo.toml +++ b/polkadot/runtime/westend/constants/Cargo.toml @@ -6,6 +6,9 @@ authors.workspace = true edition.workspace = true license.workspace = true +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [lints] workspace = true diff --git a/prdoc/pr_5173.prdoc b/prdoc/pr_5173.prdoc new file mode 100644 index 0000000000000000000000000000000000000000..81ddcd9578ba164a0615e846c3ae4ca2f66ab1e6 --- /dev/null +++ b/prdoc/pr_5173.prdoc @@ -0,0 +1,39 @@ +title: "Umbrella crate: exclude chain-specific crates" + +doc: + - audience: Runtime Dev + description: | + The `polkadot-sdk` umbrella crate does now not contain chain-specific crates. The reasoning is + that the SDK should be mostly chain-agnostic. Please check out + [psvm](https://github.com/paritytech/psvm) to select matching version numbers for chain- + specific crates. + +crates: + - name: polkadot-sdk + bump: major + - name: rococo-runtime-constants + bump: none + - name: westend-runtime-constants + bump: none + - name: bp-asset-hub-rococo + bump: none + - name: bp-asset-hub-westend + bump: none + - name: bp-bridge-hub-cumulus + bump: none + - name: bp-bridge-hub-kusama + bump: none + - name: bp-bridge-hub-polkadot + bump: none + - name: bp-bridge-hub-rococo + bump: none + - name: bp-bridge-hub-westend + bump: none + - name: bp-kusama + bump: none + - name: bp-polkadot-bulletin + bump: none + - name: bp-rococo + bump: none + - name: bp-westend + bump: none diff --git a/scripts/generate-umbrella.py b/scripts/generate-umbrella.py index a5f7d3b925672c6900ad7d7b57406a1dd50f884b..3293c30bc828ea8f53522f238d14808db154ee55 100644 --- a/scripts/generate-umbrella.py +++ b/scripts/generate-umbrella.py @@ -24,12 +24,13 @@ Crate names that should be excluded from the umbrella crate. """ def exclude(crate): name = crate.name - if crate.metadata.get("polkadot-sdk.skip-umbrella", False): + if crate.metadata.get("polkadot-sdk.exclude-from-umbrella", False): return True # No fuzzers or examples: if "example" in name or name.endswith("fuzzer"): return True + # No runtime crates: if name.endswith("-runtime"): # Note: this is a bit hacky. We should use custom crate metadata instead. diff --git a/umbrella/Cargo.toml b/umbrella/Cargo.toml index 8d85e26d8fe71b663c09cf980051205399c25847..65ff9a81e474783192d958ed39fa1a3f75100583 100644 --- a/umbrella/Cargo.toml +++ b/umbrella/Cargo.toml @@ -10,25 +10,14 @@ std = [ "asset-test-utils?/std", "assets-common?/std", "binary-merkle-tree?/std", - "bp-asset-hub-rococo?/std", - "bp-asset-hub-westend?/std", - "bp-bridge-hub-cumulus?/std", - "bp-bridge-hub-kusama?/std", - "bp-bridge-hub-polkadot?/std", - "bp-bridge-hub-rococo?/std", - "bp-bridge-hub-westend?/std", "bp-header-chain?/std", - "bp-kusama?/std", "bp-messages?/std", "bp-parachains?/std", - "bp-polkadot-bulletin?/std", "bp-polkadot-core?/std", "bp-polkadot?/std", "bp-relayers?/std", - "bp-rococo?/std", "bp-runtime?/std", "bp-test-utils?/std", - "bp-westend?/std", "bp-xcm-bridge-hub-router?/std", "bp-xcm-bridge-hub?/std", "bridge-hub-common?/std", @@ -171,7 +160,6 @@ std = [ "polkadot-runtime-metrics?/std", "polkadot-runtime-parachains?/std", "polkadot-sdk-frame?/std", - "rococo-runtime-constants?/std", "sc-executor?/std", "slot-range-helper?/std", "snowbridge-beacon-primitives?/std", @@ -239,7 +227,6 @@ std = [ "staging-xcm?/std", "substrate-bip39?/std", "testnet-parachains-constants?/std", - "westend-runtime-constants?/std", "xcm-runtime-apis?/std", ] runtime-benchmarks = [ @@ -543,25 +530,14 @@ with-tracing = [ runtime = [ "assets-common", "binary-merkle-tree", - "bp-asset-hub-rococo", - "bp-asset-hub-westend", - "bp-bridge-hub-cumulus", - "bp-bridge-hub-kusama", - "bp-bridge-hub-polkadot", - "bp-bridge-hub-rococo", - "bp-bridge-hub-westend", "bp-header-chain", - "bp-kusama", "bp-messages", "bp-parachains", "bp-polkadot", - "bp-polkadot-bulletin", "bp-polkadot-core", "bp-relayers", - "bp-rococo", "bp-runtime", "bp-test-utils", - "bp-westend", "bp-xcm-bridge-hub", "bp-xcm-bridge-hub-router", "bridge-hub-common", @@ -706,7 +682,6 @@ runtime = [ "polkadot-runtime-parachains", "polkadot-sdk-frame", "polkadot-sdk-frame?/runtime", - "rococo-runtime-constants", "sc-chain-spec-derive", "sc-tracing-proc-macro", "slot-range-helper", @@ -777,7 +752,6 @@ runtime = [ "substrate-bip39", "testnet-parachains-constants", "tracing-gum-proc-macro", - "westend-runtime-constants", "xcm-procedural", "xcm-runtime-apis", ] @@ -803,51 +777,11 @@ path = "../substrate/utils/binary-merkle-tree" default-features = false optional = true -[dependencies.bp-asset-hub-rococo] -path = "../bridges/chains/chain-asset-hub-rococo" -default-features = false -optional = true - -[dependencies.bp-asset-hub-westend] -path = "../bridges/chains/chain-asset-hub-westend" -default-features = false -optional = true - -[dependencies.bp-bridge-hub-cumulus] -path = "../bridges/chains/chain-bridge-hub-cumulus" -default-features = false -optional = true - -[dependencies.bp-bridge-hub-kusama] -path = "../bridges/chains/chain-bridge-hub-kusama" -default-features = false -optional = true - -[dependencies.bp-bridge-hub-polkadot] -path = "../bridges/chains/chain-bridge-hub-polkadot" -default-features = false -optional = true - -[dependencies.bp-bridge-hub-rococo] -path = "../bridges/chains/chain-bridge-hub-rococo" -default-features = false -optional = true - -[dependencies.bp-bridge-hub-westend] -path = "../bridges/chains/chain-bridge-hub-westend" -default-features = false -optional = true - [dependencies.bp-header-chain] path = "../bridges/primitives/header-chain" default-features = false optional = true -[dependencies.bp-kusama] -path = "../bridges/chains/chain-kusama" -default-features = false -optional = true - [dependencies.bp-messages] path = "../bridges/primitives/messages" default-features = false @@ -863,11 +797,6 @@ path = "../bridges/chains/chain-polkadot" default-features = false optional = true -[dependencies.bp-polkadot-bulletin] -path = "../bridges/chains/chain-polkadot-bulletin" -default-features = false -optional = true - [dependencies.bp-polkadot-core] path = "../bridges/primitives/polkadot-core" default-features = false @@ -878,11 +807,6 @@ path = "../bridges/primitives/relayers" default-features = false optional = true -[dependencies.bp-rococo] -path = "../bridges/chains/chain-rococo" -default-features = false -optional = true - [dependencies.bp-runtime] path = "../bridges/primitives/runtime" default-features = false @@ -893,11 +817,6 @@ path = "../bridges/primitives/test-utils" default-features = false optional = true -[dependencies.bp-westend] -path = "../bridges/chains/chain-westend" -default-features = false -optional = true - [dependencies.bp-xcm-bridge-hub] path = "../bridges/primitives/xcm-bridge-hub" default-features = false @@ -1613,11 +1532,6 @@ path = "../substrate/frame" default-features = false optional = true -[dependencies.rococo-runtime-constants] -path = "../polkadot/runtime/rococo/constants" -default-features = false -optional = true - [dependencies.sc-chain-spec-derive] path = "../substrate/client/chain-spec/derive" default-features = false @@ -1968,11 +1882,6 @@ path = "../polkadot/node/gum/proc-macro" default-features = false optional = true -[dependencies.westend-runtime-constants] -path = "../polkadot/runtime/westend/constants" -default-features = false -optional = true - [dependencies.xcm-procedural] path = "../polkadot/xcm/procedural" default-features = false diff --git a/umbrella/src/lib.rs b/umbrella/src/lib.rs index 58a5691961d9b8abc01098ef75065d92881127db..07f1cbad12620ebd3d18af9e5df8009ed407ada1 100644 --- a/umbrella/src/lib.rs +++ b/umbrella/src/lib.rs @@ -23,42 +23,10 @@ pub use assets_common; #[cfg(feature = "binary-merkle-tree")] pub use binary_merkle_tree; -/// Primitives of AssetHubRococo parachain runtime. -#[cfg(feature = "bp-asset-hub-rococo")] -pub use bp_asset_hub_rococo; - -/// Primitives of AssetHubWestend parachain runtime. -#[cfg(feature = "bp-asset-hub-westend")] -pub use bp_asset_hub_westend; - -/// Primitives for BridgeHub parachain runtimes. -#[cfg(feature = "bp-bridge-hub-cumulus")] -pub use bp_bridge_hub_cumulus; - -/// Primitives of BridgeHubKusama parachain runtime. -#[cfg(feature = "bp-bridge-hub-kusama")] -pub use bp_bridge_hub_kusama; - -/// Primitives of BridgeHubPolkadot parachain runtime. -#[cfg(feature = "bp-bridge-hub-polkadot")] -pub use bp_bridge_hub_polkadot; - -/// Primitives of BridgeHubRococo parachain runtime. -#[cfg(feature = "bp-bridge-hub-rococo")] -pub use bp_bridge_hub_rococo; - -/// Primitives of BridgeHubWestend parachain runtime. -#[cfg(feature = "bp-bridge-hub-westend")] -pub use bp_bridge_hub_westend; - /// A common interface for describing what a bridge pallet should be able to do. #[cfg(feature = "bp-header-chain")] pub use bp_header_chain; -/// Primitives of Kusama runtime. -#[cfg(feature = "bp-kusama")] -pub use bp_kusama; - /// Primitives of messages module. #[cfg(feature = "bp-messages")] pub use bp_messages; @@ -71,10 +39,6 @@ pub use bp_parachains; #[cfg(feature = "bp-polkadot")] pub use bp_polkadot; -/// Primitives of Polkadot Bulletin chain runtime. -#[cfg(feature = "bp-polkadot-bulletin")] -pub use bp_polkadot_bulletin; - /// Primitives of Polkadot-like runtime. #[cfg(feature = "bp-polkadot-core")] pub use bp_polkadot_core; @@ -83,10 +47,6 @@ pub use bp_polkadot_core; #[cfg(feature = "bp-relayers")] pub use bp_relayers; -/// Primitives of Rococo runtime. -#[cfg(feature = "bp-rococo")] -pub use bp_rococo; - /// Primitives that may be used at (bridges) runtime level. #[cfg(feature = "bp-runtime")] pub use bp_runtime; @@ -95,10 +55,6 @@ pub use bp_runtime; #[cfg(feature = "bp-test-utils")] pub use bp_test_utils; -/// Primitives of Westend runtime. -#[cfg(feature = "bp-westend")] -pub use bp_westend; - /// Primitives of the xcm-bridge-hub pallet. #[cfg(feature = "bp-xcm-bridge-hub")] pub use bp_xcm_bridge_hub; @@ -967,10 +923,6 @@ pub use polkadot_statement_distribution; #[cfg(feature = "polkadot-statement-table")] pub use polkadot_statement_table; -/// Constants used throughout the Rococo network. -#[cfg(feature = "rococo-runtime-constants")] -pub use rococo_runtime_constants; - /// Collection of allocator implementations. #[cfg(feature = "sc-allocator")] pub use sc_allocator; @@ -1552,10 +1504,6 @@ pub use tracing_gum; #[cfg(feature = "tracing-gum-proc-macro")] pub use tracing_gum_proc_macro; -/// Constants used throughout the Westend network. -#[cfg(feature = "westend-runtime-constants")] -pub use westend_runtime_constants; - /// Test kit to emulate XCM program execution. #[cfg(feature = "xcm-emulator")] pub use xcm_emulator;