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 the Polkadot Coretime runtime #410

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b673c30
Add coretime-polkadot (wip)
seadanda Jul 18, 2024
d2a6a00
Account for differences in plurarlities
seadanda Jul 18, 2024
656f167
Add coretime-polkadot to workspace, chain specs and matrix
seadanda Jul 18, 2024
5975445
Add constants
seadanda Jul 18, 2024
0c93d34
Incorporate changes from main
seadanda Jul 30, 2024
e6d074d
Add coretime-polkadot emulated tests scaffolding
seadanda Jul 30, 2024
f0fab0c
Add to chainspec generator
seadanda Jul 30, 2024
e20ddfe
Remove RPC from matrix
seadanda Jul 30, 2024
85af703
Update changelog
seadanda Jul 30, 2024
09a73f4
Remove magic number from burning logic
seadanda Jul 31, 2024
020580f
Allow unpaid execution from system parachains
seadanda Aug 1, 2024
932f5aa
Make clippy happy
seadanda Aug 1, 2024
82a6195
Merge branch 'polkadot-fellows:main' into donal-coretime-polkadot
seadanda Aug 5, 2024
d56ae0b
Merge branch 'main' into donal-coretime-polkadot
seadanda Aug 5, 2024
aad1fd7
Merge branch 'main' into donal-coretime-polkadot
seadanda Aug 6, 2024
6fa2c2d
Merge branch 'main' into donal-coretime-polkadot
seadanda Aug 8, 2024
9e13618
Add LocationToAccountAPI to coretime-polkadot
seadanda Aug 8, 2024
560aa90
Add coretime chain to trustedteleporters
seadanda Aug 9, 2024
49e7099
Add emulated tests for hardcoded weights in Coretime Chain
seadanda Aug 8, 2024
97c1ebe
fmt
seadanda Aug 9, 2024
5f56215
clippy
seadanda Aug 12, 2024
34cfe85
Apply suggestions from code review
seadanda Aug 12, 2024
717550e
Rename PERIOD->SESSION_LENGTH
seadanda Aug 12, 2024
0bd3889
Typos
seadanda Aug 12, 2024
c0cd2bb
Refactor preset names into genesis_config_presets
seadanda Aug 12, 2024
eb08500
Merge branch 'main' into donal-coretime-polkadot
seadanda Aug 12, 2024
461f46d
Use preset in chainspec generator
seadanda Aug 12, 2024
bad805a
Update system-parachains/coretime/coretime-polkadot/src/lib.rs
seadanda Aug 13, 2024
c843e48
Merge branch 'main' into donal-coretime-polkadot
seadanda Aug 13, 2024
752ffd9
Merge branch 'main' into donal-coretime-polkadot
seadanda Aug 13, 2024
5fa7629
Fix after merge
seadanda Aug 13, 2024
f5efa3d
Merge branch 'main' into donal-coretime-polkadot
fellowship-merge-bot[bot] Aug 13, 2024
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 .github/workflows/runtimes-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@
"uri": "wss://kusama-coretime-rpc.polkadot.io:443",
"is_relay": false
},
{
"name": "coretime-polkadot",
"package": "coretime-polkadot-runtime",
"path": "system-parachains/coretime/coretime-polkadot",
"is_relay": false
},
{
"name": "people-kusama",
"package": "people-kusama-runtime",
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- All runtimes: XcmPaymentApi and DryRunApi ([polkadot-fellows/runtimes#380](https://github.com/polkadot-fellows/runtimes/pull/380))
- All runtimes: add `LocationToAccountApi` ([polkadot-fellows/runtimes#413](https://github.com/polkadot-fellows/runtimes/pull/413))
- Enable Agile Coretime on Polkadot ([polkadot-fellows/runtimes#401](https://github.com/polkadot-fellows/runtimes/pull/401))
- Add the Polkadot Coretime Chain runtime ([polkadot-fellows/runtimes#410](https://github.com/polkadot-fellows/runtimes/pull/410))

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

Expand Down
145 changes: 122 additions & 23 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ collectives-polkadot-runtime = { path = "system-parachains/collectives/collectiv
collectives-polkadot-runtime-constants = { path = "system-parachains/collectives/collectives-polkadot/constants" }
coretime-kusama-emulated-chain = { path = "integration-tests/emulated/chains/parachains/coretime/coretime-kusama" }
coretime-kusama-runtime = { path = "system-parachains/coretime/coretime-kusama" }
coretime-polkadot-emulated-chain = { path = "integration-tests/emulated/chains/parachains/coretime/coretime-polkadot" }
coretime-polkadot-runtime = { path = "system-parachains/coretime/coretime-polkadot" }
cumulus-pallet-aura-ext = { version = "0.15.0", default-features = false }
cumulus-pallet-dmp-queue = { version = "0.15.0", default-features = false }
cumulus-pallet-parachain-system = { version = "0.15.0", default-features = false }
Expand Down Expand Up @@ -253,6 +255,7 @@ members = [
"integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot",
"integration-tests/emulated/chains/parachains/collectives/collectives-polkadot",
"integration-tests/emulated/chains/parachains/coretime/coretime-kusama",
"integration-tests/emulated/chains/parachains/coretime/coretime-polkadot",
"integration-tests/emulated/chains/parachains/people/people-kusama",
"integration-tests/emulated/chains/parachains/people/people-polkadot",
"integration-tests/emulated/chains/parachains/testing/penpal",
Expand All @@ -268,6 +271,7 @@ members = [
"integration-tests/emulated/tests/bridges/bridge-hub-polkadot",
"integration-tests/emulated/tests/collectives/collectives-polkadot",
"integration-tests/emulated/tests/coretime/coretime-kusama",
"integration-tests/emulated/tests/coretime/coretime-polkadot",
"integration-tests/emulated/tests/people/people-kusama",
"integration-tests/emulated/tests/people/people-polkadot",
"integration-tests/zombienet",
Expand All @@ -287,6 +291,7 @@ members = [
"system-parachains/collectives/collectives-polkadot/constants",
"system-parachains/constants",
"system-parachains/coretime/coretime-kusama",
"system-parachains/coretime/coretime-polkadot",
"system-parachains/encointer",
"system-parachains/gluttons/glutton-kusama",
"system-parachains/people/people-kusama",
Expand Down
2 changes: 2 additions & 0 deletions chain-spec-generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ bridge-hub-kusama-runtime = { workspace = true }
encointer-kusama-runtime = { workspace = true }
glutton-kusama-runtime = { workspace = true }
coretime-kusama-runtime = { workspace = true }
coretime-polkadot-runtime = { workspace = true }
people-kusama-runtime = { workspace = true }
people-polkadot-runtime = { workspace = true }

Expand All @@ -36,6 +37,7 @@ runtime-benchmarks = [
"bridge-hub-polkadot-runtime/runtime-benchmarks",
"collectives-polkadot-runtime/runtime-benchmarks",
"coretime-kusama-runtime/runtime-benchmarks",
"coretime-polkadot-runtime/runtime-benchmarks",
"encointer-kusama-runtime/runtime-benchmarks",
"glutton-kusama-runtime/runtime-benchmarks",
"kusama-runtime/runtime-benchmarks",
Expand Down
2 changes: 2 additions & 0 deletions chain-spec-generator/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ pub fn from_json_file(filepath: &str, supported: String) -> Result<Box<dyn Chain
Ok(Box::new(BridgeHubKusamaChainSpec::from_json_file(path)?)),
x if x.starts_with("coretime-kusama") =>
Ok(Box::new(CoretimeKusamaChainSpec::from_json_file(path)?)),
x if x.starts_with("coretime-polkadot") =>
Ok(Box::new(CoretimeKusamaChainSpec::from_json_file(path)?)),
x if x.starts_with("glutton-kusama") =>
Ok(Box::new(GluttonKusamaChainSpec::from_json_file(path)?)),
x if x.starts_with("encointer-kusama") =>
Expand Down
4 changes: 4 additions & 0 deletions chain-spec-generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ fn main() -> Result<(), String> {
"coretime-kusama-local",
Box::new(system_parachains_specs::coretime_kusama_local_testnet_config) as Box<_>,
),
(
"coretime-polkadot-local",
Box::new(system_parachains_specs::coretime_polkadot_local_testnet_config) as Box<_>,
),
(
"people-kusama-local",
Box::new(system_parachains_specs::people_kusama_local_testnet_config) as Box<_>,
Expand Down
22 changes: 22 additions & 0 deletions chain-spec-generator/src/system_parachains_specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ pub type EncointerKusamaChainSpec = sc_chain_spec::GenericChainSpec<Extensions>;

pub type CoretimeKusamaChainSpec = sc_chain_spec::GenericChainSpec<Extensions>;

pub type CoretimePolkadotChainSpec = sc_chain_spec::GenericChainSpec<Extensions>;

pub type PeopleKusamaChainSpec = sc_chain_spec::GenericChainSpec<Extensions>;

pub type PeoplePolkadotChainSpec = sc_chain_spec::GenericChainSpec<Extensions>;
Expand Down Expand Up @@ -216,6 +218,26 @@ pub fn coretime_kusama_local_testnet_config() -> Result<Box<dyn ChainSpec>, Stri
))
}

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());
properties.insert("tokenSymbol".into(), "DOT".into());
properties.insert("tokenDecimals".into(), 10.into());

Ok(Box::new(
CoretimePolkadotChainSpec::builder(
coretime_polkadot_runtime::WASM_BINARY.expect("CoretimePolkadot wasm not available!"),
Extensions { relay_chain: "polkadot-local".into(), para_id: 1005 },
)
.with_name("Polkadot Coretime Local")
.with_id("coretime-polkadot-local")
.with_chain_type(ChainType::Local)
.with_genesis_config_preset_name("local_testnet")
.with_properties(properties)
.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
@@ -1,6 +1,6 @@
[package]
name = "coretime-kusama-emulated-chain"
version = "0.0.0"
version.workspace = true
authors.workspace = true
edition.workspace = true
license = "Apache-2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use emulated_integration_tests_common::{
};
use parachains_common::Balance;

pub const PARA_ID: u32 = 1001;
pub const PARA_ID: u32 = 1005;
pub const ED: Balance = coretime_kusama_runtime::ExistentialDeposit::get();

pub fn genesis() -> Storage {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "coretime-polkadot-emulated-chain"
version.workspace = true
authors.workspace = true
edition.workspace = true
license = "Apache-2.0"
description = "Coretime Polkadot emulated chain used for integration tests"
publish = false

[dependencies]

# Substrate
sp-core = { workspace = true, default-features = true }
frame-support = { workspace = true, default-features = true }

# Cumulus
parachains-common = { workspace = true, default-features = true }
cumulus-primitives-core = { workspace = true, default-features = true }
emulated-integration-tests-common = { workspace = true }

# Runtimes
coretime-polkadot-runtime = { workspace = true }
Loading
Loading