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

Polkadot People Chain #319

Merged
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5c602c6
relay side
joepetrowski May 21, 2024
b742b05
add parachain runtime
joepetrowski May 21, 2024
19cdd2f
add integration tests
joepetrowski May 21, 2024
5ed4c8c
requires ED to teleport
joepetrowski May 21, 2024
2077279
fmt tests
joepetrowski May 21, 2024
56c6e20
fmt para runtime
joepetrowski May 21, 2024
056f42c
changelog
joepetrowski May 21, 2024
f88342a
add to CI
joepetrowski May 21, 2024
9781543
don't actually need ED, but check account needs to exist
joepetrowski May 21, 2024
f1d7909
merge main
joepetrowski May 21, 2024
c70411e
better solution that doesn't break teleport tests
joepetrowski May 21, 2024
f1fb5ab
fmt
joepetrowski May 21, 2024
88e8cc1
fmt (again)
joepetrowski May 21, 2024
c3370b0
merge main
joepetrowski May 22, 2024
e3c9e0a
Update system-parachains/people/people-polkadot/src/xcm_config.rs
joepetrowski May 29, 2024
afebcdc
Merge branch 'main' into polkadot-people
joepetrowski May 29, 2024
6940d9b
address review
joepetrowski May 29, 2024
3fea564
add type
joepetrowski May 30, 2024
f940d8d
Add people-polkadot to chain-spec-generator
bkontur May 30, 2024
83fc1dd
Added `[cumulus_pallet_parachain_system, ParachainSystem]`
bkontur May 30, 2024
cb67828
Added `[pallet_message_queue, MessageQueue]`
bkontur May 30, 2024
ae1debc
Fresh weights for people-polkadot
bkontur May 30, 2024
87be706
Fresh weights for people-kusama
bkontur May 30, 2024
0a64c66
Merge pull request #2 from bkontur/polkadot-people
joepetrowski May 30, 2024
5f81b5b
Weights for `polkadot_runtime_common::identity_migrator`
bkontur May 30, 2024
bfa4d77
Fix import
bkontur May 30, 2024
253ce14
Merge pull request #3 from bkontur/polkadot-people
joepetrowski Jun 6, 2024
7145189
Merge branch 'main' into polkadot-people
joepetrowski Jun 6, 2024
5ab9908
merge main
joepetrowski Jun 6, 2024
28bfe29
fix merge and build
joepetrowski Jun 6, 2024
61e3e5b
add metadata extension
joepetrowski Jun 7, 2024
27811dd
Fix `reap_identity` benchmark
bkontur Jun 7, 2024
f7018da
Merge pull request #5 from bkontur/polkadot-people
joepetrowski Jun 7, 2024
c370ff1
Change prefix
bkontur Jun 7, 2024
7896ee7
Fresh weights for `polkadot_runtime_common_identity_migrator` for `po…
bkontur Jun 7, 2024
ee84347
Just rename `runtime_common_*` files to correct `polkadot_runtime_com…
bkontur Jun 7, 2024
ba5480c
Merge pull request #6 from bkontur/polkadot-people
joepetrowski Jun 8, 2024
1899db3
remove unneeded migration
joepetrowski Jun 10, 2024
3290734
bump affected versions
joepetrowski Jun 10, 2024
6b0872b
merge main
joepetrowski Jun 11, 2024
7e3ac8c
fix changelog
joepetrowski Jun 11, 2024
91fd406
Merge branch 'main' into polkadot-people
joepetrowski Jun 13, 2024
c214dd8
Merge branch 'main' into polkadot-people
joepetrowski Jun 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
4 changes: 4 additions & 0 deletions .github/workflows/integration-tests-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
"name": "people-kusama",
"package": "people-kusama-integration-tests"
},
{
"name": "people-polkadot",
"package": "people-polkadot-integration-tests"
},
{
"name": "collectives-polkadot",
"package": "collectives-polkadot-integration-tests"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added

- Staking runtime api to check if reward is pending for an era ([polkadot-fellows/runtimes#318](https://github.com/polkadot-fellows/runtimes/pull/318))
- Add the Polkadot People Chain ([polkadot-fellows/runtimes#319](https://github.com/polkadot-fellows/runtimes/pull/319))

### Fixed

Expand Down
102 changes: 102 additions & 0 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 @@ -169,6 +169,8 @@ penpal-emulated-chain = { path = "integration-tests/emulated/chains/parachains/t
penpal-runtime = { version = "0.15.1" }
people-kusama-emulated-chain = { path = "integration-tests/emulated/chains/parachains/people/people-kusama" }
people-kusama-runtime = { path = "system-parachains/people/people-kusama" }
people-polkadot-emulated-chain = { path = "integration-tests/emulated/chains/parachains/people/people-polkadot" }
people-polkadot-runtime = { path = "system-parachains/people/people-polkadot" }
polkadot-core-primitives = { version = "8.0.0", default-features = false }
polkadot-emulated-chain = { path = "integration-tests/emulated/chains/relays/polkadot" }
polkadot-parachain-primitives = { version = "7.0.0", default-features = false }
Expand Down Expand Up @@ -245,6 +247,7 @@ members = [
"integration-tests/emulated/chains/parachains/bridges/bridge-hub-polkadot",
"integration-tests/emulated/chains/parachains/collectives/collectives-polkadot",
"integration-tests/emulated/chains/parachains/people/people-kusama",
"integration-tests/emulated/chains/parachains/people/people-polkadot",
"integration-tests/emulated/chains/parachains/testing/penpal",
"integration-tests/emulated/chains/relays/kusama",
"integration-tests/emulated/chains/relays/polkadot",
Expand All @@ -258,6 +261,7 @@ members = [
"integration-tests/emulated/tests/bridges/bridge-hub-polkadot",
"integration-tests/emulated/tests/collectives/collectives-polkadot",
"integration-tests/emulated/tests/people/people-kusama",
"integration-tests/emulated/tests/people/people-polkadot",
"relay/kusama",
"relay/kusama/constants",
"relay/polkadot",
Expand All @@ -277,6 +281,7 @@ members = [
"system-parachains/encointer",
"system-parachains/gluttons/glutton-kusama",
"system-parachains/people/people-kusama",
"system-parachains/people/people-polkadot",
"integration-tests/zombienet",
]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "people-polkadot-emulated-chain"
authors.workspace = true
edition.workspace = true
version.workspace = true
license = "Apache-2.0"
description = "People 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 }

# Local
people-polkadot-runtime = { workspace = true }
polkadot-emulated-chain = { workspace = true }
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// 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 cumulus_primitives_core::ParaId;
use emulated_integration_tests_common::{build_genesis_storage, collators, SAFE_XCM_VERSION};
use parachains_common::Balance;

pub const PARA_ID: u32 = 1004;
pub const ED: Balance = people_polkadot_runtime::ExistentialDeposit::get();

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

build_genesis_storage(
&genesis_config,
people_polkadot_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,52 @@
// 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_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain,
impls::Parachain, xcm_emulator::decl_test_parachains,
};

// PeoplePolkadot Parachain declaration
decl_test_parachains! {
pub struct PeoplePolkadot {
genesis = genesis::genesis(),
on_init = {
people_polkadot_runtime::AuraExt::on_initialize(1);
},
runtime = people_polkadot_runtime,
core = {
XcmpMessageHandler: people_polkadot_runtime::XcmpQueue,
LocationToAccountId: people_polkadot_runtime::xcm_config::LocationToAccountId,
ParachainInfo: people_polkadot_runtime::ParachainInfo,
MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin,
},
pallets = {
PolkadotXcm: people_polkadot_runtime::PolkadotXcm,
Balances: people_polkadot_runtime::Balances,
Identity: people_polkadot_runtime::Identity,
IdentityMigrator: people_polkadot_runtime::IdentityMigrator,
}
},
}

// PeoplePolkadot implementation
impl_accounts_helpers_for_parachain!(PeoplePolkadot);
impl_assert_events_helpers_for_parachain!(PeoplePolkadot);
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ decl_test_relay_chains! {
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 @@ -18,3 +18,4 @@ bridge-hub-polkadot-emulated-chain = { workspace = true }
collectives-polkadot-emulated-chain = { workspace = true }
penpal-emulated-chain = { workspace = true }
polkadot-emulated-chain = { workspace = true }
people-polkadot-emulated-chain = { workspace = true }
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ pub use asset_hub_polkadot_emulated_chain;
pub use bridge_hub_polkadot_emulated_chain;
pub use collectives_polkadot_emulated_chain;
pub use penpal_emulated_chain;
pub use people_polkadot_emulated_chain;
pub use polkadot_emulated_chain;

use asset_hub_polkadot_emulated_chain::AssetHubPolkadot;
use bridge_hub_polkadot_emulated_chain::BridgeHubPolkadot;
use collectives_polkadot_emulated_chain::CollectivesPolkadot;
use penpal_emulated_chain::{PenpalA, PenpalB};
use people_polkadot_emulated_chain::PeoplePolkadot;
use polkadot_emulated_chain::Polkadot;

// Cumulus
Expand All @@ -40,6 +42,7 @@ decl_test_networks! {
CollectivesPolkadot,
PenpalA,
PenpalB,
PeoplePolkadot,
],
bridge = ()
},
Expand All @@ -51,5 +54,6 @@ decl_test_sender_receiver_accounts_parameter_types! {
BridgeHubPolkadotPara { sender: ALICE, receiver: BOB },
CollectivesPolkadotPara { sender: ALICE, receiver: BOB },
PenpalAPara { sender: ALICE, receiver: BOB },
PenpalBPara { sender: ALICE, receiver: BOB }
PenpalBPara { sender: ALICE, receiver: BOB },
PeoplePolkadotPara { sender: ALICE, receiver: BOB }
}
37 changes: 37 additions & 0 deletions integration-tests/emulated/tests/people/people-polkadot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[package]
name = "people-polkadot-integration-tests"
version.workspace = true
authors.workspace = true
edition.workspace = true
license = "Apache-2.0"
description = "People Polkadot runtime integration tests with xcm-emulator"
publish = false

[dependencies]
codec = { workspace = true, default-features = true }

# Substrate
sp-runtime = { workspace = true, default-features = true }
frame-support = { workspace = true, default-features = true }
pallet-balances = { workspace = true, default-features = true }
pallet-message-queue = { workspace = true, default-features = true }
pallet-identity = { workspace = true, default-features = true }

# Polkadot
polkadot-runtime-common = { workspace = true, default-features = true }
xcm = { workspace = true, default-features = true }
xcm-executor = { workspace = true }

# Cumulus
parachains-common = { workspace = true, default-features = true }
emulated-integration-tests-common = { workspace = true }
asset-test-utils = { workspace = true }
cumulus-pallet-parachain-system = { features = [
"parameterized-consensus-hook",
], workspace = true, default-features = true }

# Local
polkadot-runtime-constants = { workspace = true, default-features = true }
polkadot-runtime = { workspace = true }
people-polkadot-runtime = { workspace = true }
polkadot-system-emulated-network = { workspace = true }
Loading
Loading