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 XCM emulator tests for Coretime #2316

Closed
wants to merge 87 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
5d418be
coretime node
joepetrowski Sep 9, 2023
b5cb317
runtime
joepetrowski Sep 9, 2023
e88c889
updates since monorepo
joepetrowski Sep 9, 2023
8f6acd9
scripts
joepetrowski Sep 9, 2023
f193d9a
import path fix
joepetrowski Sep 9, 2023
f0c2ffe
propagate features
joepetrowski Sep 9, 2023
f90d059
propagate features again
joepetrowski Sep 9, 2023
e2c25a1
add experimental feature
joepetrowski Sep 9, 2023
13d3cbe
propagate features again
joepetrowski Sep 9, 2023
e672f78
somehow escaped fmt
joepetrowski Sep 11, 2023
e965b35
Merge remote-tracking branch 'origin' into joe-coretime-chain
joepetrowski Sep 11, 2023
1063a6a
Merge branch 'master' into joe-coretime-chain
joepetrowski Sep 12, 2023
be8b135
with trailing topic
joepetrowski Sep 12, 2023
87720cc
Merge remote-tracking branch 'origin' into joe-coretime-chain
joepetrowski Sep 13, 2023
d2753d9
add node requirements for rococo and westend runtimes
joepetrowski Sep 13, 2023
9affefe
add separate runtimes for rococo and westend
joepetrowski Sep 13, 2023
6f579d1
missing rococo parts
joepetrowski Sep 13, 2023
d9e8b85
actually include missing parts in commit
joepetrowski Sep 13, 2023
3840349
prelim broker integration to rococo
joepetrowski Sep 14, 2023
df9be31
Merge remote-tracking branch 'origin' into joe-coretime-chain
joepetrowski Sep 16, 2023
9c283dd
merge master
joepetrowski Sep 19, 2023
26bf95c
send coretime revenue to staking pot
joepetrowski Sep 19, 2023
efed2e2
Merge remote-tracking branch 'origin' into joe-coretime-chain
joepetrowski Sep 27, 2023
96625bf
merge master
joepetrowski Oct 8, 2023
cfee13b
coretimeallocator
joepetrowski Oct 8, 2023
b196f46
merge master
joepetrowski Oct 26, 2023
6a1d1ad
Remove native runtime constants from coretime runtimes
seadanda Oct 24, 2023
f00c403
Make runtimes compile
seadanda Nov 6, 2023
fa231ef
Add assign_core and mock CoretimeProvider
seadanda Nov 10, 2023
db713a7
Fix XCM parent/sibling delivery fee price
seadanda Nov 10, 2023
cc88547
Merge branch 'master' into joe-coretime-chain
seadanda Nov 13, 2023
1812039
Add TransactAsset and DeliveryHelper to runtimes
seadanda Nov 13, 2023
291d7f9
Disable calls to broker pallet
seadanda Nov 13, 2023
3035ddd
Rename parachain-info in coretime
seadanda Nov 13, 2023
f63e1b9
Remove coretime-kusama and -polkadot
seadanda Nov 13, 2023
6ef731d
Remove native coretime runtimes from parachain-bin
seadanda Nov 14, 2023
0238143
Update coretime message queues for 1246
seadanda Nov 14, 2023
619c38e
Include all pallets in define_benchmarks
seadanda Nov 14, 2023
99cf792
Add missing licenses in coretime runtimes
seadanda Nov 14, 2023
61b3933
Add rest of CoretimeInterface mocks
seadanda Nov 14, 2023
af2ae03
Revert over-zealous benchmark additions
seadanda Nov 14, 2023
bd51c3b
create initial structure
0xmovses Nov 14, 2023
e2b5c8a
Merge branch 'joe-coretime-chain' into 0xmovses-coretime-xcm-tests
0xmovses Nov 14, 2023
9a54cb8
update emulated chain
0xmovses Nov 14, 2023
b1a892b
Merge branch 'master' into joe-coretime-chain
seadanda Nov 14, 2023
fc570a4
add genesis
0xmovses Nov 14, 2023
621d7c9
add xcm execute test
0xmovses Nov 14, 2023
b0f8f1d
Bootstrap weights
seadanda Nov 14, 2023
c4f4b64
Merge branch 'master' into joe-coretime-chain
seadanda Nov 15, 2023
9163ebe
Fix pallet_xcm benchmarking after master merge
seadanda Nov 15, 2023
594c0f1
Merge branch 'master' into joe-coretime-chain
seadanda Nov 15, 2023
99791f2
remove assets helpers macro
0xmovses Nov 15, 2023
6db64aa
add coretime-wococo support
0xmovses Nov 15, 2023
6b48af6
remove redunant
0xmovses Nov 15, 2023
735cb5c
add basic xcm test
0xmovses Nov 15, 2023
ec22d98
updates
0xmovses Nov 15, 2023
b2497e2
remove wococo
0xmovses Nov 15, 2023
36ba5f2
Impl WeightInfo for () to avoid missing chainspec
seadanda Nov 15, 2023
fcd1bdc
Merge branch 'master' into joe-coretime-chain
seadanda Nov 15, 2023
c4aa490
Fix missing bracket from github merge editor
seadanda Nov 15, 2023
3508e8c
Switch out mock for fixed indices
seadanda Nov 15, 2023
4b51067
Remove kusama and polkadot coretime chainspecs
seadanda Nov 15, 2023
4bf348e
Reorder generics in CoreProviderCalls
seadanda Nov 15, 2023
cf56761
assign_core test passing, use pallet_broker
0xmovses Nov 16, 2023
565a177
remove unused
0xmovses Nov 16, 2023
0c2e940
Merge branch 'joe-coretime-chain' into 0xmovses-coretime-xcm-tests
0xmovses Nov 16, 2023
bca0ab6
add teleport tests
0xmovses Nov 16, 2023
e2e9e59
add back pallet_coretime_mock
0xmovses Nov 16, 2023
b639507
modify command
0xmovses Nov 17, 2023
6943cea
Revert "modify command"
0xmovses Nov 17, 2023
f69c803
Merge branch 'joe-coretime-chain' into 0xmovses-coretime-xcm-tests
0xmovses Nov 17, 2023
98659da
update teleport tests
0xmovses Nov 20, 2023
c35a889
Generate chain specs and head data
seadanda Nov 21, 2023
563aee9
Add rococo-coretime-local
seadanda Nov 22, 2023
97039ec
Add boot nodes, invulnerables and session keys
seadanda Nov 22, 2023
5df967e
Revert "Impl WeightInfo for () to avoid missing chainspec"
seadanda Nov 22, 2023
60fde52
Remove unnecessary files
seadanda Nov 24, 2023
f1aca09
Add coretime-rococo live chainspec
seadanda Nov 24, 2023
ea2892c
Set origin to Native and add Decode trait bound
seadanda Nov 24, 2023
9de69ac
remove mock
0xmovses Nov 24, 2023
9244059
Add broker weights
seadanda Nov 24, 2023
8dea375
Add westend local and dev chainspecs
seadanda Nov 29, 2023
a378202
Merge branch 'master' into joe-coretime-chain
seadanda Nov 29, 2023
d7f8e0d
Merge branch 'master' into joe-coretime-chain
seadanda Nov 29, 2023
a5d14b4
Make chainspec script run for westend
seadanda Nov 30, 2023
eac1350
Regenerate coretime-rococo live chainspec
seadanda Nov 30, 2023
386431b
fix conflicts
0xmovses Dec 4, 2023
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
10 changes: 10 additions & 0 deletions .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ build-test-parachain:

# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-bridge-hubs
# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-contracts
# DAG: build-runtime-assets -> build-runtime-coretime
# DAG: build-runtime-assets -> build-runtime-starters -> build-runtime-testing
build-runtime-assets:
<<: *build-runtime-template
Expand All @@ -235,6 +236,15 @@ build-runtime-collectives:
- job: build-runtime-assets
artifacts: false

build-runtime-coretime:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "cumulus/parachains/runtimes/coretime"
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: build-runtime-assets
artifacts: false

build-runtime-bridge-hubs:
<<: *build-runtime-template
variables:
Expand Down
164 changes: 164 additions & 0 deletions Cargo.lock

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

11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ members = [
"cumulus/parachain-template/pallets/template",
"cumulus/parachain-template/runtime",
"cumulus/parachains/common",
"cumulus/parachains/integration-tests/emulated/tests/coretime/coretime-rococo",
"cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo",
"cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-westend",
"cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo",
"cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-westend",
"cumulus/parachains/integration-tests/emulated/common",
"cumulus/parachains/integration-tests/emulated/chains/relays/rococo",
"cumulus/parachains/integration-tests/emulated/chains/relays/westend",
"cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo",
"cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-rococo",
"cumulus/parachains/integration-tests/emulated/chains/parachains/assets/asset-hub-westend",
"cumulus/parachains/integration-tests/emulated/chains/parachains/bridges/bridge-hub-rococo",
Expand All @@ -84,6 +93,8 @@ members = [
"cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo",
"cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend",
"cumulus/parachains/runtimes/bridge-hubs/test-utils",
"cumulus/parachains/runtimes/coretime/coretime-rococo",
"cumulus/parachains/runtimes/coretime/coretime-westend",
"cumulus/parachains/runtimes/collectives/collectives-westend",
"cumulus/parachains/runtimes/contracts/contracts-rococo",
"cumulus/parachains/runtimes/glutton/glutton-westend",
Expand Down
Empty file added chain-spec-plain.json
Empty file.
70 changes: 70 additions & 0 deletions cumulus/parachains/chain-specs/coretime-rococo.json

Large diffs are not rendered by default.

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "coretime-rococo-emulated-chain"
version = "0.0.0"
authors.workspace = true
edition.workspace = true
license = "Apache-2.0"
description = "Coretime Rococo emulated chain"
publish = false

[dependencies]
serde_json = "1.0.104"

# Substrate
sp-core = { path = "../../../../../../../../substrate/primitives/core", default-features = false }
sp-runtime = { path = "../../../../../../../../substrate/primitives/runtime", default-features = false }
frame-support = { path = "../../../../../../../../substrate/frame/support", default-features = false }

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

# Cumulus
cumulus-primitives-core = { path = "../../../../../../../primitives/core", default-features = false }
emulated-integration-tests-common = { path = "../../../../common", default-features = false }
coretime-rococo-runtime = { path = "../../../../../../runtimes/coretime/coretime-rococo" }
rococo-emulated-chain = { path = "../../../relays/rococo" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Substrate
use sp_core::storage::Storage;

// Cumulus
use emulated_integration_tests_common::{
accounts, build_genesis_storage, collators, SAFE_XCM_VERSION,
};
use parachains_common::Balance;

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

pub fn genesis() -> Storage {
let genesis_config = coretime_rococo_runtime::RuntimeGenesisConfig {
system: coretime_rococo_runtime::SystemConfig::default(),
balances: coretime_rococo_runtime::BalancesConfig {
balances: accounts::init_balances()
.iter()
.cloned()
.map(|k| (k, ED * 4096 * 4096))
.collect(),
},
parachain_info: coretime_rococo_runtime::ParachainInfoConfig {
parachain_id: PARA_ID.into(),
..Default::default()
},
collator_selection: coretime_rococo_runtime::CollatorSelectionConfig {
invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(),
candidacy_bond: ED * 16,
..Default::default()
},
session: coretime_rococo_runtime::SessionConfig {
keys: collators::invulnerables()
.into_iter()
.map(|(acc, aura)| {
(
acc.clone(), // account id
acc, // validator id
coretime_rococo_runtime::SessionKeys { aura }, // session keys
)
})
.collect(),
},
polkadot_xcm: coretime_rococo_runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
..Default::default()
},
..Default::default()
};

build_genesis_storage(
&genesis_config,
coretime_rococo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

pub mod genesis;

// Substrate
use frame_support::traits::OnInitialize;

// Cumulus
use emulated_integration_tests_common::{
impl_assert_events_helpers_for_parachain, xcm_emulator::decl_test_parachains,
};

// Coretime Parachain declaration
decl_test_parachains! {
pub struct CoretimeRococo {
genesis = genesis::genesis(),
on_init = {
coretime_rococo_runtime::AuraExt::on_initialize(1);
},
runtime = coretime_rococo_runtime,
core = {
XcmpMessageHandler: coretime_rococo_runtime::XcmpQueue,
LocationToAccountId: coretime_rococo_runtime::xcm_config::LocationToAccountId,
ParachainInfo: coretime_rococo_runtime::ParachainInfo,
},
pallets = {
PolkadotXcm: coretime_rococo_runtime::PolkadotXcm,
Balances: coretime_rococo_runtime::Balances,
Broker: coretime_rococo_runtime::Broker,
}
},
}

// CoretimeRococo implementation
impl_assert_events_helpers_for_parachain!(CoretimeRococo);
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ emulated-integration-tests-common = { path = "../../common", default-features =
rococo-emulated-chain = { path = "../../chains/relays/rococo" }
asset-hub-rococo-emulated-chain = { path = "../../chains/parachains/assets/asset-hub-rococo" }
bridge-hub-rococo-emulated-chain = { path = "../../chains/parachains/bridges/bridge-hub-rococo" }
coretime-rococo-emulated-chain = { path = "../../chains/parachains/coretime/coretime-rococo" }
penpal-emulated-chain = { path = "../../chains/parachains/testing/penpal" }
Loading