Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add coretime chainspecs for kusama and polkadot and presets for live chains #4

Merged
merged 17 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Runtime apis to help with delegate-stake based Nomination Pools ([SDK v1.13 #4537](https://github.com/paritytech/polkadot-sdk/pull/4537)).
- Kusama system chains: enable PoV-reclaim.

### Added

- Fast promotion tracks for the Fellowship ranks I-III ([polkadot-fellows/runtimes#356](https://github.com/polkadot-fellows/runtimes/pull/356)).

### Changed

- Polkadot chains: allow arbitrary XCM execution ([polkadot-fellows/runtimes#345](https://github.com/polkadot-fellows/runtimes/pull/345)).
- Bounties: Remove payout delay ([polkadot-fellows/runtimes#386](https://github.com/polkadot-fellows/runtimes/pull/386)).
- Polkadot System Chains: Reduce the base transaction fee by half ([polkadot-fellows/runtimes#398](https://github.com/polkadot-fellows/runtimes/pull/398)).

Expand Down Expand Up @@ -105,6 +110,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- Remove deprecated calls from treasury pallet ([runtimes#381](https://github.com/polkadot-fellows/runtimes/pull/381), [SDK v1.14 #3820](https://github.com/paritytech/polkadot-sdk/pull/3820)).
- Treasury pallet: - remove unused config parameters ([runtimes#381](https://github.com/polkadot-fellows/runtimes/pull/381), [SDK v1.14 #4831](https://github.com/paritytech/polkadot-sdk/pull/4831)).
- Remove Identity from Polkadot Relay Chain ([runtimes#415](https://github.com/polkadot-fellows/runtimes/pull/415))

#### From [#322](https://github.com/polkadot-fellows/runtimes/pull/322):

Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,9 @@ polkadot-system-emulated-network = { path = "integration-tests/emulated/networks
primitive-types = { version = "0.12.2", default-features = false }
frame-metadata-hash-extension = { version = "0.4.0", default-features = false }
remote-externalities = { version = "0.43.0", package = "frame-remote-externalities" }
runtime-parachains = { version = "15.0.0", default-features = false, package = "polkadot-runtime-parachains" }
runtime-parachains = { version = "15.0.1", default-features = false, package = "polkadot-runtime-parachains" }
sc-chain-spec = { version = "35.0.0" }
sc-network = { version = "0.42.0" }
scale-info = { version = "2.10.0", default-features = false }
separator = { version = "0.4.1" }
serde = { version = "1.0.196" }
Expand Down
1 change: 1 addition & 0 deletions chain-spec-generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ polkadot-runtime = { workspace = true }
kusama-runtime = { workspace = true }

sc-chain-spec = { workspace = true }
sc-network = { workspace = true }

asset-hub-polkadot-runtime = { workspace = true }
asset-hub-kusama-runtime = { workspace = true }
Expand Down
8 changes: 8 additions & 0 deletions chain-spec-generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,18 @@ fn main() -> Result<(), String> {
"encointer-kusama-local",
Box::new(system_parachains_specs::encointer_kusama_local_testnet_config) as Box<_>,
),
(
"coretime-kusama",
Box::new(system_parachains_specs::coretime_kusama_config) as Box<_>,
),
(
"coretime-kusama-local",
Box::new(system_parachains_specs::coretime_kusama_local_testnet_config) as Box<_>,
),
(
"coretime-polkadot",
Box::new(system_parachains_specs::coretime_polkadot_config) as Box<_>,
),
(
"coretime-polkadot-local",
Box::new(system_parachains_specs::coretime_polkadot_local_testnet_config) as Box<_>,
Expand Down
80 changes: 80 additions & 0 deletions chain-spec-generator/src/system_parachains_specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

use sc_chain_spec::{ChainSpec, ChainSpecExtension, ChainSpecGroup, ChainType};
use sc_network::config::MultiaddrWithPeerId;
use serde::{Deserialize, Serialize};
use std::str::FromStr;

/// Generic extensions for Parachain ChainSpecs.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)]
Expand Down Expand Up @@ -218,6 +220,45 @@ pub fn coretime_kusama_local_testnet_config() -> Result<Box<dyn ChainSpec>, Stri
))
}

pub fn coretime_kusama_config() -> Result<Box<dyn ChainSpec>, String> {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 2.into());
properties.insert("tokenSymbol".into(), "KSM".into());
properties.insert("tokenDecimals".into(), 12.into());

let boot_nodes = [
"/dns/kusama-coretime-connect-a-0.polkadot.io/tcp/30334/p2p/12D3KooWR7Biy6nPgQFhk2eYP62pAkcFA6he9RUFURTDh7ewTjpo",
"/dns/kusama-coretime-connect-a-1.polkadot.io/tcp/30334/p2p/12D3KooWAGFiMZDF9RxdacrkenzGdo8nhfSe9EXofHc5mHeJ9vGX",
"/dns/kusama-coretime-connect-a-0.polkadot.io/tcp/443/wss/p2p/12D3KooWR7Biy6nPgQFhk2eYP62pAkcFA6he9RUFURTDh7ewTjpo",
"/dns/kusama-coretime-connect-a-1.polkadot.io/tcp/443/wss/p2p/12D3KooWAGFiMZDF9RxdacrkenzGdo8nhfSe9EXofHc5mHeJ9vGX",
];

Ok(Box::new(
CoretimeKusamaChainSpec::builder(
coretime_kusama_runtime::WASM_BINARY.expect("Kusama Coretime wasm not available!"),
Extensions { relay_chain: "kusama".into(), para_id: 1005 },
)
.with_name("Kusama Coretime")
.with_id("coretime-kusama")
.with_chain_type(ChainType::Live)
.with_genesis_config_patch(
seadanda marked this conversation as resolved.
Show resolved Hide resolved
coretime_kusama_runtime::genesis_config_presets::coretime_kusama_live_genesis(
1005.into(),
),
)
.with_properties(properties)
.with_boot_nodes(
boot_nodes
.iter()
.map(|addr| {
MultiaddrWithPeerId::from_str(addr).expect("Boot node address is incorrect.")
})
.collect(),
)
.build(),
))
}

pub fn coretime_polkadot_local_testnet_config() -> Result<Box<dyn ChainSpec>, String> {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 0.into());
Expand All @@ -242,6 +283,45 @@ pub fn coretime_polkadot_local_testnet_config() -> Result<Box<dyn ChainSpec>, St
))
}

pub fn coretime_polkadot_config() -> Result<Box<dyn ChainSpec>, String> {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 0.into());
properties.insert("tokenSymbol".into(), "DOT".into());
properties.insert("tokenDecimals".into(), 10.into());

let boot_nodes = [
"/dns/polkadot-coretime-connect-a-0.polkadot.io/tcp/30334/p2p/12D3KooWKjnixAHbKMsPTJwGx8SrBeGEJLHA8KmKcEDYMp3YmWgR",
"/dns/polkadot-coretime-connect-a-1.polkadot.io/tcp/30334/p2p/12D3KooWQ7B7p4DFv1jWqaKfhrZBcMmi5g8bWFnmskguLaGEmT6n",
"/dns/polkadot-coretime-connect-a-0.polkadot.io/tcp/443/wss/p2p/12D3KooWKjnixAHbKMsPTJwGx8SrBeGEJLHA8KmKcEDYMp3YmWgR",
"/dns/polkadot-coretime-connect-a-1.polkadot.io/tcp/443/wss/p2p/12D3KooWQ7B7p4DFv1jWqaKfhrZBcMmi5g8bWFnmskguLaGEmT6n",
];

Ok(Box::new(
CoretimePolkadotChainSpec::builder(
coretime_polkadot_runtime::WASM_BINARY.expect("Polkadot Coretime wasm not available!"),
Extensions { relay_chain: "polkadot".into(), para_id: 1005 },
)
.with_name("Polkadot Coretime")
.with_id("coretime-polkadot")
.with_chain_type(ChainType::Live)
.with_genesis_config_patch(
seadanda marked this conversation as resolved.
Show resolved Hide resolved
coretime_polkadot_runtime::genesis_config_presets::coretime_polkadot_live_genesis(
1005.into(),
),
)
.with_properties(properties)
.with_boot_nodes(
boot_nodes
.iter()
.map(|addr| {
MultiaddrWithPeerId::from_str(addr).expect("Boot node address is incorrect.")
})
.collect(),
)
.build(),
))
}

pub fn people_kusama_local_testnet_config() -> Result<Box<dyn ChainSpec>, String> {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 2.into());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ decl_test_parachains! {
PolkadotXcm: people_polkadot_runtime::PolkadotXcm,
Balances: people_polkadot_runtime::Balances,
Identity: people_polkadot_runtime::Identity,
IdentityMigrator: people_polkadot_runtime::IdentityMigrator,
}
},
}
Expand Down
2 changes: 0 additions & 2 deletions integration-tests/emulated/chains/relays/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ decl_test_relay_chains! {
Treasury: polkadot_runtime::Treasury,
AssetRate: polkadot_runtime::AssetRate,
Hrmp: polkadot_runtime::Hrmp,
Identity: polkadot_runtime::Identity,
IdentityMigrator: polkadot_runtime::IdentityMigrator,
}
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@
// limitations under the License.

mod governance;
mod reap_identity;
mod teleport;
Loading
Loading