From c3dd345c5f69a580c88d87ea0681741eda899599 Mon Sep 17 00:00:00 2001 From: Raymond Cheung <178801527+raymondkfcheung@users.noreply.github.com> Date: Fri, 6 Jun 2025 09:26:37 +0100 Subject: [PATCH 1/9] Ensure Consistent Topic IDs for Traceable Cross-Chain XCM --- CHANGELOG.md | 1 + .../coretime/coretime-kusama/src/tests/coretime_interface.rs | 5 +++++ .../coretime-polkadot/src/tests/coretime_interface.rs | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff567c63b6..434e8b3fde 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - [[#711](https://github.com/polkadot-fellows/runtimes/pull/711)] Only allow apply slash to be executed if the slash amount is atleast ED ([SDK stable2503 #6540](https://github.com/paritytech/polkadot-sdk/pull/6540)). - [[#711](https://github.com/polkadot-fellows/runtimes/pull/711)] Paras-registrar: Improve error reporting ([SDK stable2503 #6989](https://github.com/paritytech/polkadot-sdk/pull/6989)). - [[#711](https://github.com/polkadot-fellows/runtimes/pull/711)] Xcm: convert properly assets in xcmpayment apis ([SDK stable2503 #7134](https://github.com/paritytech/polkadot-sdk/pull/7134)). +- Ensure Consistent Topic IDs for Traceable Cross-Chain XCM ([polkadot-fellows/runtimes/pull/739](https://github.com/polkadot-fellows/runtimes/pull/739)) ### Fixed diff --git a/integration-tests/emulated/tests/coretime/coretime-kusama/src/tests/coretime_interface.rs b/integration-tests/emulated/tests/coretime/coretime-kusama/src/tests/coretime_interface.rs index 1f7d513829..776720bed1 100644 --- a/integration-tests/emulated/tests/coretime/coretime-kusama/src/tests/coretime_interface.rs +++ b/integration-tests/emulated/tests/coretime/coretime-kusama/src/tests/coretime_interface.rs @@ -15,6 +15,7 @@ use crate::*; use frame_support::traits::OnInitialize; +use kusama_runtime::Dmp; use kusama_runtime_constants::system_parachain::coretime::TIMESLICE_PERIOD; use pallet_broker::{ConfigRecord, Configuration, CoreAssignment, CoreMask, ScheduleItem}; use sp_runtime::Perbill; @@ -34,6 +35,10 @@ fn transact_hardcoded_weights_are_sane() { type CoretimeEvent = ::RuntimeEvent; type RelayEvent = ::RuntimeEvent; + Kusama::execute_with(|| { + Dmp::make_parachain_reachable(CoretimeKusama::para_id()); + }); + // Reserve a workload, configure broker and start sales. CoretimeKusama::execute_with(|| { // Hooks don't run in emulated tests - workaround as we need `on_initialize` to tick things diff --git a/integration-tests/emulated/tests/coretime/coretime-polkadot/src/tests/coretime_interface.rs b/integration-tests/emulated/tests/coretime/coretime-polkadot/src/tests/coretime_interface.rs index c0317301f2..d896c6951f 100644 --- a/integration-tests/emulated/tests/coretime/coretime-polkadot/src/tests/coretime_interface.rs +++ b/integration-tests/emulated/tests/coretime/coretime-polkadot/src/tests/coretime_interface.rs @@ -16,6 +16,7 @@ use crate::*; use frame_support::traits::OnInitialize; use pallet_broker::{ConfigRecord, Configuration, CoreAssignment, CoreMask, ScheduleItem}; +use polkadot_runtime::Dmp; use polkadot_runtime_constants::system_parachain::coretime::TIMESLICE_PERIOD; use sp_runtime::Perbill; @@ -34,6 +35,10 @@ fn transact_hardcoded_weights_are_sane() { type CoretimeEvent = ::RuntimeEvent; type RelayEvent = ::RuntimeEvent; + Polkadot::execute_with(|| { + Dmp::make_parachain_reachable(CoretimePolkadot::para_id()); + }); + // Reserve a workload, configure broker and start sales. CoretimePolkadot::execute_with(|| { // Hooks don't run in emulated tests - workaround as we need `on_initialize` to tick things From e69e0c1b6bb8ee641d46203f8d2cf19b690d1653 Mon Sep 17 00:00:00 2001 From: Raymond Cheung <178801527+raymondkfcheung@users.noreply.github.com> Date: Fri, 6 Jun 2025 15:00:29 +0100 Subject: [PATCH 2/9] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 434e8b3fde..8fb0e725a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - [[#711](https://github.com/polkadot-fellows/runtimes/pull/711)] Only allow apply slash to be executed if the slash amount is atleast ED ([SDK stable2503 #6540](https://github.com/paritytech/polkadot-sdk/pull/6540)). - [[#711](https://github.com/polkadot-fellows/runtimes/pull/711)] Paras-registrar: Improve error reporting ([SDK stable2503 #6989](https://github.com/paritytech/polkadot-sdk/pull/6989)). - [[#711](https://github.com/polkadot-fellows/runtimes/pull/711)] Xcm: convert properly assets in xcmpayment apis ([SDK stable2503 #7134](https://github.com/paritytech/polkadot-sdk/pull/7134)). -- Ensure Consistent Topic IDs for Traceable Cross-Chain XCM ([polkadot-fellows/runtimes/pull/739](https://github.com/polkadot-fellows/runtimes/pull/739)) +- Ensure Consistent Topic IDs for Traceable Cross-Chain XCM ([polkadot-fellows/runtimes/pull/759](https://github.com/polkadot-fellows/runtimes/pull/759)) ### Fixed From b9e4b6b9d86c91908cda5dbd6ca98d59733c67be Mon Sep 17 00:00:00 2001 From: Raymond Cheung <178801527+raymondkfcheung@users.noreply.github.com> Date: Mon, 9 Jun 2025 13:45:28 +0100 Subject: [PATCH 3/9] Update IT matrix --- .github/workflows/integration-tests-matrix.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/integration-tests-matrix.json b/.github/workflows/integration-tests-matrix.json index 48ce7e5681..e7cf6f55a3 100644 --- a/.github/workflows/integration-tests-matrix.json +++ b/.github/workflows/integration-tests-matrix.json @@ -26,5 +26,13 @@ { "name": "collectives-polkadot", "package": "collectives-polkadot-integration-tests" + }, + { + "name": "coretime-kusama", + "package": "coretime-kusama-integration-tests" + }, + { + "name": "coretime-polkadot", + "package": "coretime-polkadot-integration-tests" } ] From 23839bd496e5a067ca6bc01c347cc2be1f1db19c Mon Sep 17 00:00:00 2001 From: Raymond Cheung <178801527+raymondkfcheung@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:16:20 +0100 Subject: [PATCH 4/9] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a711752d78..48a2f3f515 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - [[#711](https://github.com/polkadot-fellows/runtimes/pull/711)] Only allow apply slash to be executed if the slash amount is atleast ED ([SDK stable2503 #6540](https://github.com/paritytech/polkadot-sdk/pull/6540)). - [[#711](https://github.com/polkadot-fellows/runtimes/pull/711)] Paras-registrar: Improve error reporting ([SDK stable2503 #6989](https://github.com/paritytech/polkadot-sdk/pull/6989)). - [[#711](https://github.com/polkadot-fellows/runtimes/pull/711)] Xcm: convert properly assets in xcmpayment apis ([SDK stable2503 #7134](https://github.com/paritytech/polkadot-sdk/pull/7134)). -- Ensure Consistent Topic IDs for Traceable Cross-Chain XCM ([polkadot-fellows/runtimes/pull/759](https://github.com/polkadot-fellows/runtimes/pull/759)) + - [[#711](https://github.com/polkadot-fellows/runtimes/pull/711)] Ensure Consistent Topic IDs for Traceable Cross-Chain XCM ([SDK stable2503 #7691](https://github.com/paritytech/polkadot-sdk/pull/7691)). ### Fixed From 034429bf37c5a46cd581ea4f9c9c474c01ef4d8e Mon Sep 17 00:00:00 2001 From: Raymond Cheung <178801527+raymondkfcheung@users.noreply.github.com> Date: Tue, 10 Jun 2025 10:40:32 +0100 Subject: [PATCH 5/9] Reduce MinimumEndPrice --- system-parachains/coretime/coretime-kusama/src/coretime.rs | 3 +-- system-parachains/coretime/coretime-polkadot/src/coretime.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/system-parachains/coretime/coretime-kusama/src/coretime.rs b/system-parachains/coretime/coretime-kusama/src/coretime.rs index e80ed1da06..15452ebb9f 100644 --- a/system-parachains/coretime/coretime-kusama/src/coretime.rs +++ b/system-parachains/coretime/coretime-kusama/src/coretime.rs @@ -322,8 +322,7 @@ impl CoretimeInterface for CoretimeAllocator { parameter_types! { pub const BrokerPalletId: PalletId = PalletId(*b"py/broke"); pub const MinimumCreditPurchase: Balance = UNITS / 10; - - pub const MinimumEndPrice: Balance = UNITS; + pub const MinimumEndPrice: Balance = UNITS / 100_000; } pub struct SovereignAccountOf; diff --git a/system-parachains/coretime/coretime-polkadot/src/coretime.rs b/system-parachains/coretime/coretime-polkadot/src/coretime.rs index 0263ae6430..9346ae1eac 100644 --- a/system-parachains/coretime/coretime-polkadot/src/coretime.rs +++ b/system-parachains/coretime/coretime-polkadot/src/coretime.rs @@ -319,7 +319,7 @@ impl CoretimeInterface for CoretimeAllocator { parameter_types! { pub const BrokerPalletId: PalletId = PalletId(*b"py/broke"); pub const MinimumCreditPurchase: Balance = UNITS / 10; - pub const MinimumEndPrice: Balance = 10 * UNITS; + pub const MinimumEndPrice: Balance = UNITS / 10_000; } pub struct SovereignAccountOf; From 2f9068356250726f1d428a6501a091bbcbf92c42 Mon Sep 17 00:00:00 2001 From: Raymond Cheung <178801527+raymondkfcheung@users.noreply.github.com> Date: Tue, 10 Jun 2025 11:19:51 +0100 Subject: [PATCH 6/9] Revert "Reduce MinimumEndPrice" This reverts commit 034429bf37c5a46cd581ea4f9c9c474c01ef4d8e. --- system-parachains/coretime/coretime-kusama/src/coretime.rs | 3 ++- system-parachains/coretime/coretime-polkadot/src/coretime.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/system-parachains/coretime/coretime-kusama/src/coretime.rs b/system-parachains/coretime/coretime-kusama/src/coretime.rs index 15452ebb9f..e80ed1da06 100644 --- a/system-parachains/coretime/coretime-kusama/src/coretime.rs +++ b/system-parachains/coretime/coretime-kusama/src/coretime.rs @@ -322,7 +322,8 @@ impl CoretimeInterface for CoretimeAllocator { parameter_types! { pub const BrokerPalletId: PalletId = PalletId(*b"py/broke"); pub const MinimumCreditPurchase: Balance = UNITS / 10; - pub const MinimumEndPrice: Balance = UNITS / 100_000; + + pub const MinimumEndPrice: Balance = UNITS; } pub struct SovereignAccountOf; diff --git a/system-parachains/coretime/coretime-polkadot/src/coretime.rs b/system-parachains/coretime/coretime-polkadot/src/coretime.rs index 9346ae1eac..0263ae6430 100644 --- a/system-parachains/coretime/coretime-polkadot/src/coretime.rs +++ b/system-parachains/coretime/coretime-polkadot/src/coretime.rs @@ -319,7 +319,7 @@ impl CoretimeInterface for CoretimeAllocator { parameter_types! { pub const BrokerPalletId: PalletId = PalletId(*b"py/broke"); pub const MinimumCreditPurchase: Balance = UNITS / 10; - pub const MinimumEndPrice: Balance = UNITS / 10_000; + pub const MinimumEndPrice: Balance = 10 * UNITS; } pub struct SovereignAccountOf; From aa89bb88afc7e7f2a8a62ce2ad7d317743c654b6 Mon Sep 17 00:00:00 2001 From: Raymond Cheung <178801527+raymondkfcheung@users.noreply.github.com> Date: Tue, 10 Jun 2025 12:46:56 +0100 Subject: [PATCH 7/9] Fix tests --- system-parachains/coretime/coretime-kusama/src/tests.rs | 4 ++-- system-parachains/coretime/coretime-polkadot/src/tests.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system-parachains/coretime/coretime-kusama/src/tests.rs b/system-parachains/coretime/coretime-kusama/src/tests.rs index b5bcd7886f..c5333361d5 100644 --- a/system-parachains/coretime/coretime-kusama/src/tests.rs +++ b/system-parachains/coretime/coretime-kusama/src/tests.rs @@ -96,14 +96,14 @@ fn bulk_revenue_is_burnt() { let broker_account = BrokerPalletId::get().into_account_truncating(); let coretime_burn_account = CoretimeBurnAccount::get(); let treasury_account = xcm_config::RelayTreasuryPalletAccount::get(); - assert_ok!(Balances::mint_into(&AccountId::from(ALICE), 200 * ed)); + assert_ok!(Balances::mint_into(&AccountId::from(ALICE), 2_000_000 * ed)); let alice_balance_before = Balances::balance(&AccountId::from(ALICE)); let treasury_balance_before = Balances::balance(&treasury_account); let broker_balance_before = Balances::balance(&broker_account); let burn_balance_before = Balances::balance(&coretime_burn_account); // Purchase coretime. - assert_ok!(Broker::purchase(RuntimeOrigin::signed(AccountId::from(ALICE)), 100 * ed)); + assert_ok!(Broker::purchase(RuntimeOrigin::signed(AccountId::from(ALICE)), 1_000_000 * ed)); // Alice decreases. assert!(Balances::balance(&AccountId::from(ALICE)) < alice_balance_before); diff --git a/system-parachains/coretime/coretime-polkadot/src/tests.rs b/system-parachains/coretime/coretime-polkadot/src/tests.rs index a1e23c9c55..60f93f9967 100644 --- a/system-parachains/coretime/coretime-polkadot/src/tests.rs +++ b/system-parachains/coretime/coretime-polkadot/src/tests.rs @@ -96,14 +96,14 @@ fn bulk_revenue_is_burnt() { let broker_account = BrokerPalletId::get().into_account_truncating(); let coretime_burn_account = CoretimeBurnAccount::get(); let treasury_account = xcm_config::RelayTreasuryPalletAccount::get(); - assert_ok!(Balances::mint_into(&AccountId::from(ALICE), 200 * ed)); + assert_ok!(Balances::mint_into(&AccountId::from(ALICE), 200_000 * ed)); let alice_balance_before = Balances::balance(&AccountId::from(ALICE)); let treasury_balance_before = Balances::balance(&treasury_account); let broker_balance_before = Balances::balance(&broker_account); let burn_balance_before = Balances::balance(&coretime_burn_account); // Purchase coretime. - assert_ok!(Broker::purchase(RuntimeOrigin::signed(AccountId::from(ALICE)), 100 * ed)); + assert_ok!(Broker::purchase(RuntimeOrigin::signed(AccountId::from(ALICE)), 100_000 * ed)); // Alice decreases. assert!(Balances::balance(&AccountId::from(ALICE)) < alice_balance_before); From 267b5c3ba8b117d43044e8257a323496220eab43 Mon Sep 17 00:00:00 2001 From: Raymond Cheung <178801527+raymondkfcheung@users.noreply.github.com> Date: Tue, 10 Jun 2025 13:02:06 +0100 Subject: [PATCH 8/9] Fix fmt --- system-parachains/coretime/coretime-kusama/src/tests.rs | 5 ++++- system-parachains/coretime/coretime-polkadot/src/tests.rs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/system-parachains/coretime/coretime-kusama/src/tests.rs b/system-parachains/coretime/coretime-kusama/src/tests.rs index c5333361d5..2f0b183bd3 100644 --- a/system-parachains/coretime/coretime-kusama/src/tests.rs +++ b/system-parachains/coretime/coretime-kusama/src/tests.rs @@ -103,7 +103,10 @@ fn bulk_revenue_is_burnt() { let burn_balance_before = Balances::balance(&coretime_burn_account); // Purchase coretime. - assert_ok!(Broker::purchase(RuntimeOrigin::signed(AccountId::from(ALICE)), 1_000_000 * ed)); + assert_ok!(Broker::purchase( + RuntimeOrigin::signed(AccountId::from(ALICE)), + 1_000_000 * ed + )); // Alice decreases. assert!(Balances::balance(&AccountId::from(ALICE)) < alice_balance_before); diff --git a/system-parachains/coretime/coretime-polkadot/src/tests.rs b/system-parachains/coretime/coretime-polkadot/src/tests.rs index 60f93f9967..e1c63d3bcf 100644 --- a/system-parachains/coretime/coretime-polkadot/src/tests.rs +++ b/system-parachains/coretime/coretime-polkadot/src/tests.rs @@ -103,7 +103,10 @@ fn bulk_revenue_is_burnt() { let burn_balance_before = Balances::balance(&coretime_burn_account); // Purchase coretime. - assert_ok!(Broker::purchase(RuntimeOrigin::signed(AccountId::from(ALICE)), 100_000 * ed)); + assert_ok!(Broker::purchase( + RuntimeOrigin::signed(AccountId::from(ALICE)), + 100_000 * ed + )); // Alice decreases. assert!(Balances::balance(&AccountId::from(ALICE)) < alice_balance_before); From 286d429d69600ba5aab632f56018a3d71c6f09a1 Mon Sep 17 00:00:00 2001 From: Raymond Cheung <178801527+raymondkfcheung@users.noreply.github.com> Date: Tue, 10 Jun 2025 13:36:42 +0100 Subject: [PATCH 9/9] Use UNITS instead of ExistentialDeposit --- system-parachains/coretime/coretime-kusama/src/tests.rs | 7 +++---- system-parachains/coretime/coretime-polkadot/src/tests.rs | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/system-parachains/coretime/coretime-kusama/src/tests.rs b/system-parachains/coretime/coretime-kusama/src/tests.rs index 2f0b183bd3..38a88455f2 100644 --- a/system-parachains/coretime/coretime-kusama/src/tests.rs +++ b/system-parachains/coretime/coretime-kusama/src/tests.rs @@ -85,9 +85,8 @@ fn bulk_revenue_is_burnt() { renewal_bump: Perbill::from_percent(3), contribution_timeout: 1, }; - let ed = ExistentialDeposit::get(); assert_ok!(Broker::configure(RuntimeOrigin::root(), config.clone())); - assert_ok!(Broker::start_sales(RuntimeOrigin::root(), ed, 1)); + assert_ok!(Broker::start_sales(RuntimeOrigin::root(), UNITS, 1)); let sale_start = SaleInfo::::get().unwrap().sale_start; advance_to(sale_start + config.interlude_length); @@ -96,7 +95,7 @@ fn bulk_revenue_is_burnt() { let broker_account = BrokerPalletId::get().into_account_truncating(); let coretime_burn_account = CoretimeBurnAccount::get(); let treasury_account = xcm_config::RelayTreasuryPalletAccount::get(); - assert_ok!(Balances::mint_into(&AccountId::from(ALICE), 2_000_000 * ed)); + assert_ok!(Balances::mint_into(&AccountId::from(ALICE), 200 * UNITS)); let alice_balance_before = Balances::balance(&AccountId::from(ALICE)); let treasury_balance_before = Balances::balance(&treasury_account); let broker_balance_before = Balances::balance(&broker_account); @@ -105,7 +104,7 @@ fn bulk_revenue_is_burnt() { // Purchase coretime. assert_ok!(Broker::purchase( RuntimeOrigin::signed(AccountId::from(ALICE)), - 1_000_000 * ed + 100 * UNITS )); // Alice decreases. diff --git a/system-parachains/coretime/coretime-polkadot/src/tests.rs b/system-parachains/coretime/coretime-polkadot/src/tests.rs index e1c63d3bcf..fe7ea6a291 100644 --- a/system-parachains/coretime/coretime-polkadot/src/tests.rs +++ b/system-parachains/coretime/coretime-polkadot/src/tests.rs @@ -85,9 +85,8 @@ fn bulk_revenue_is_burnt() { renewal_bump: Perbill::from_percent(3), contribution_timeout: 1, }; - let ed = ExistentialDeposit::get(); assert_ok!(Broker::configure(RuntimeOrigin::root(), config.clone())); - assert_ok!(Broker::start_sales(RuntimeOrigin::root(), ed, 1)); + assert_ok!(Broker::start_sales(RuntimeOrigin::root(), UNITS, 1)); let sale_start = SaleInfo::::get().unwrap().sale_start; advance_to(sale_start + config.interlude_length); @@ -96,7 +95,7 @@ fn bulk_revenue_is_burnt() { let broker_account = BrokerPalletId::get().into_account_truncating(); let coretime_burn_account = CoretimeBurnAccount::get(); let treasury_account = xcm_config::RelayTreasuryPalletAccount::get(); - assert_ok!(Balances::mint_into(&AccountId::from(ALICE), 200_000 * ed)); + assert_ok!(Balances::mint_into(&AccountId::from(ALICE), 200 * UNITS)); let alice_balance_before = Balances::balance(&AccountId::from(ALICE)); let treasury_balance_before = Balances::balance(&treasury_account); let broker_balance_before = Balances::balance(&broker_account); @@ -105,7 +104,7 @@ fn bulk_revenue_is_burnt() { // Purchase coretime. assert_ok!(Broker::purchase( RuntimeOrigin::signed(AccountId::from(ALICE)), - 100_000 * ed + 100 * UNITS )); // Alice decreases.