Skip to content

Commit

Permalink
Remove im-online pallet from Rococo and Westend (#2265)
Browse files Browse the repository at this point in the history
Co-authored-by: ordian <[email protected]>
Co-authored-by: Vladimir Istyufeev <[email protected]>
  • Loading branch information
3 people authored Nov 28, 2023
1 parent f01781a commit c5f211d
Show file tree
Hide file tree
Showing 8 changed files with 288 additions and 349 deletions.
1 change: 1 addition & 0 deletions .gitlab/pipeline/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ check-rust-feature-propagation:
time ./try-runtime ${COMMAND_EXTRA_ARGS} \
--runtime ./target/release/wbuild/"$PACKAGE"/"$WASM" \
on-runtime-upgrade --disable-spec-version-check --checks=all ${SUBCOMMAND_EXTRA_ARGS} live --uri ${URI}
sleep 5
# Check runtime migrations for Parity managed relay chains
check-runtime-migration-westend:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// Substrate
use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId;
use grandpa::AuthorityId as GrandpaId;
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_consensus_babe::AuthorityId as BabeId;
use sp_core::{sr25519, storage::Storage};
Expand All @@ -38,7 +37,6 @@ const ENDOWMENT: u128 = 1_000_000 * ROC;
fn session_keys(
babe: BabeId,
grandpa: GrandpaId,
im_online: ImOnlineId,
para_validator: ValidatorId,
para_assignment: AssignmentId,
authority_discovery: AuthorityDiscoveryId,
Expand All @@ -47,7 +45,6 @@ fn session_keys(
rococo_runtime::SessionKeys {
babe,
grandpa,
im_online,
para_validator,
para_assignment,
authority_discovery,
Expand All @@ -74,7 +71,6 @@ pub fn genesis() -> Storage {
x.4.clone(),
x.5.clone(),
x.6.clone(),
x.7.clone(),
get_from_seed::<BeefyId>("Alice"),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// Substrate
use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId;
use grandpa::AuthorityId as GrandpaId;
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_consensus_babe::AuthorityId as BabeId;
use sp_core::storage::Storage;
Expand All @@ -39,7 +38,6 @@ const STASH: u128 = 100 * WND;
fn session_keys(
babe: BabeId,
grandpa: GrandpaId,
im_online: ImOnlineId,
para_validator: ValidatorId,
para_assignment: AssignmentId,
authority_discovery: AuthorityDiscoveryId,
Expand All @@ -48,7 +46,6 @@ fn session_keys(
westend_runtime::SessionKeys {
babe,
grandpa,
im_online,
para_validator,
para_assignment,
authority_discovery,
Expand All @@ -75,7 +72,6 @@ pub fn genesis() -> Storage {
x.4.clone(),
x.5.clone(),
x.6.clone(),
x.7.clone(),
get_from_seed::<BeefyId>("Alice"),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub use xcm_emulator;

// Substrate
use grandpa::AuthorityId as GrandpaId;
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_consensus_babe::AuthorityId as BabeId;
use sp_core::{sr25519, storage::Storage, Pair, Public};
Expand Down Expand Up @@ -163,7 +162,6 @@ pub mod validators {
AccountId,
BabeId,
GrandpaId,
ImOnlineId,
ValidatorId,
AssignmentId,
AuthorityDiscoveryId,
Expand Down
64 changes: 2 additions & 62 deletions polkadot/node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId;
use grandpa::AuthorityId as GrandpaId;
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
#[cfg(feature = "westend-native")]
use pallet_staking::Forcing;
use polkadot_primitives::{AccountId, AccountPublic, AssignmentId, ValidatorId};
Expand Down Expand Up @@ -162,7 +161,6 @@ fn default_parachains_host_configuration_is_consistent() {
fn westend_session_keys(
babe: BabeId,
grandpa: GrandpaId,
im_online: ImOnlineId,
para_validator: ValidatorId,
para_assignment: AssignmentId,
authority_discovery: AuthorityDiscoveryId,
Expand All @@ -171,7 +169,6 @@ fn westend_session_keys(
westend::SessionKeys {
babe,
grandpa,
im_online,
para_validator,
para_assignment,
authority_discovery,
Expand All @@ -183,7 +180,6 @@ fn westend_session_keys(
fn rococo_session_keys(
babe: BabeId,
grandpa: GrandpaId,
im_online: ImOnlineId,
para_validator: ValidatorId,
para_assignment: AssignmentId,
authority_discovery: AuthorityDiscoveryId,
Expand All @@ -192,7 +188,6 @@ fn rococo_session_keys(
rococo_runtime::SessionKeys {
babe,
grandpa,
im_online,
para_validator,
para_assignment,
authority_discovery,
Expand Down Expand Up @@ -220,7 +215,6 @@ fn westend_staging_testnet_config_genesis() -> serde_json::Value {
AccountId,
BabeId,
GrandpaId,
ImOnlineId,
ValidatorId,
AssignmentId,
AuthorityDiscoveryId,
Expand All @@ -237,9 +231,6 @@ fn westend_staging_testnet_config_genesis() -> serde_json::Value {
//5Eb7wM65PNgtY6e33FEAzYtU5cRTXt6WQvZTnzaKQwkVcABk
hex!["6faae44b21c6f2681a7f60df708e9f79d340f7d441d28bd987fab8d05c6487e8"]
.unchecked_into(),
//5CdS2wGo4qdTQceVfEnbZH8vULeBrnGYCxSCxDna4tQSMV6y
hex!["18f5d55f138bfa8e0ea26ed6fa56817b247de3c2e2030a908c63fb37c146473f"]
.unchecked_into(),
//5FqMLAgygdX9UqzukDp15Uid9PAKdFAR621U7xtp5ut2NfrW
hex!["a6c1a5b501985a83cb1c37630c5b41e6b0a15b3675b2fd94694758e6cfa6794d"]
.unchecked_into(),
Expand All @@ -264,9 +255,6 @@ fn westend_staging_testnet_config_genesis() -> serde_json::Value {
//5FXFsPReTUEYPRNKhbTdUathcWBsxTNsLbk2mTpYdKCJewjA
hex!["98f4d81cb383898c2c3d54dab28698c0f717c81b509cb32dc6905af3cc697b18"]
.unchecked_into(),
//5CDYSCJK91r8y2r1V4Ddrit4PFMEkwZXJe8mNBqGXJ4xWCWq
hex!["06bd7dd4ab4c808c7d09d9cb6bd27fbcd99ad8400e99212b335056c475c24031"]
.unchecked_into(),
//5CZjurB78XbSHf6SLkLhCdkqw52Zm7aBYUDdfkLqEDWJ9Zhj
hex!["162508accd470e379b04cb0c7c60b35a7d5357e84407a89ed2dd48db4b726960"]
.unchecked_into(),
Expand All @@ -291,9 +279,6 @@ fn westend_staging_testnet_config_genesis() -> serde_json::Value {
//5G4kCbgqUhEyrRHCyFwFEkgBZXoYA8sbgsRxT9rY8Tp5Jj5F
hex!["b0f8d2b9e4e1eafd4dab6358e0b9d5380d78af27c094e69ae9d6d30ca300fd86"]
.unchecked_into(),
//5HVhFBLFTKSZK9fX6RktckWDTgYNoSd33fgonsEC8zfr4ddm
hex!["f03c3e184b2883eec9beaeb97f54321587e7476b228831ea0b5fc6da847ea975"]
.unchecked_into(),
//5CS7thd2n54WfqeKU3cjvZzK4z5p7zku1Zw97mSzXgPioAAs
hex!["1055100a283968271a0781450b389b9093231be809be1e48a305ebad2a90497e"]
.unchecked_into(),
Expand All @@ -318,9 +303,6 @@ fn westend_staging_testnet_config_genesis() -> serde_json::Value {
//5ChfdrAqmLjCeDJvynbMjcxYLHYzPe8UWXd3HnX9JDThUMbn
hex!["1c309a70b4e274314b84c9a0a1f973c9c4fc084df5479ef686c54b1ae4950424"]
.unchecked_into(),
//5DnsMm24575xK2b2aGfmafiDxwCet6Mr4iiZQeDdWvi8CzuF
hex!["4c64868ba6d8ace235d3efb4c10d745a67cf3bdfeae23b264d7ea2f3439dec42"]
.unchecked_into(),
//5D8C3HHEp5E8fJsXRD56494F413CdRSR9QKGXe7v5ZEfymdj
hex!["2ee4d78f328db178c54f205ac809da12e291a33bcbd4f29f081ce7e74bdc5044"]
.unchecked_into(),
Expand Down Expand Up @@ -361,7 +343,6 @@ fn westend_staging_testnet_config_genesis() -> serde_json::Value {
x.5.clone(),
x.6.clone(),
x.7.clone(),
x.8.clone(),
),
)
})
Expand Down Expand Up @@ -408,7 +389,6 @@ fn rococo_staging_testnet_config_genesis() -> serde_json::Value {
AccountId,
BabeId,
GrandpaId,
ImOnlineId,
ValidatorId,
AssignmentId,
AuthorityDiscoveryId,
Expand All @@ -425,9 +405,6 @@ fn rococo_staging_testnet_config_genesis() -> serde_json::Value {
//5CPd3zoV9Aaah4xWucuDivMHJ2nEEmpdi864nPTiyRZp4t87
hex!["0e6d7d1afbcc6547b92995a394ba0daed07a2420be08220a5a1336c6731f0bfa"]
.unchecked_into(),
//5F7BEa1LGFksUihyatf3dCDYneB8pWzVyavnByCsm5nBgezi
hex!["86975a37211f8704e947a365b720f7a3e2757988eaa7d0f197e83dba355ef743"]
.unchecked_into(),
//5CP6oGfwqbEfML8efqm1tCZsUgRsJztp9L8ZkEUxA16W8PPz
hex!["0e07a51d3213842f8e9363ce8e444255990a225f87e80a3d651db7841e1a0205"]
.unchecked_into(),
Expand All @@ -452,9 +429,6 @@ fn rococo_staging_testnet_config_genesis() -> serde_json::Value {
//5HnDVBN9mD6mXyx8oryhDbJtezwNSj1VRXgLoYCBA6uEkiao
hex!["fcd5f87a6fd5707a25122a01b4dac0a8482259df7d42a9a096606df1320df08d"]
.unchecked_into(),
//5DhyXZiuB1LvqYKFgT5tRpgGsN3is2cM9QxgW7FikvakbAZP
hex!["48a910c0af90898f11bd57d37ceaea53c78994f8e1833a7ade483c9a84bde055"]
.unchecked_into(),
//5EPEWRecy2ApL5n18n3aHyU1956zXTRqaJpzDa9DoqiggNwF
hex!["669a10892119453e9feb4e3f1ee8e028916cc3240022920ad643846fbdbee816"]
.unchecked_into(),
Expand All @@ -479,9 +453,6 @@ fn rococo_staging_testnet_config_genesis() -> serde_json::Value {
//5HAes2RQYPbYKbLBfKb88f4zoXv6pPA6Ke8CjN7dob3GpmSP
hex!["e1b68fbd84333e31486c08e6153d9a1415b2e7e71b413702b7d64e9b631184a1"]
.unchecked_into(),
//5HTXBf36LXmkFWJLokNUK6fPxVpkr2ToUnB1pvaagdGu4c1T
hex!["ee93e26259decb89afcf17ef2aa0fa2db2e1042fb8f56ecfb24d19eae8629878"]
.unchecked_into(),
//5FtAGDZYJKXkhVhAxCQrXmaP7EE2mGbBMfmKDHjfYDgq2BiU
hex!["a8e61ffacafaf546283dc92d14d7cc70ea0151a5dd81fdf73ff5a2951f2b6037"]
.unchecked_into(),
Expand All @@ -506,9 +477,6 @@ fn rococo_staging_testnet_config_genesis() -> serde_json::Value {
//5DJV3zCBTJBLGNDCcdWrYxWDacSz84goGTa4pFeKVvehEBte
hex!["36be9069cdb4a8a07ecd51f257875150f0a8a1be44a10d9d98dabf10a030aef4"]
.unchecked_into(),
//5FHf8kpK4fPjEJeYcYon2gAPwEBubRvtwpzkUbhMWSweKPUY
hex!["8e95b9b5b4dc69790b67b566567ca8bf8cdef3a3a8bb65393c0d1d1c87cd2d2c"]
.unchecked_into(),
//5F9FsRjpecP9GonktmtFL3kjqNAMKjHVFjyjRdTPa4hbQRZA
hex!["882d72965e642677583b333b2d173ac94b5fd6c405c76184bb14293be748a13b"]
.unchecked_into(),
Expand All @@ -533,9 +501,6 @@ fn rococo_staging_testnet_config_genesis() -> serde_json::Value {
//5EX1JBghGbQqWohTPU6msR9qZ2nYPhK9r3RTQ2oD1K8TCxaG
hex!["6c878e33b83c20324238d22240f735457b6fba544b383e70bb62a27b57380c81"]
.unchecked_into(),
//5GqL8RbVAuNXpDhjQi1KrS1MyNuKhvus2AbmQwRGjpuGZmFu
hex!["d2f9d537ffa59919a4028afdb627c14c14c97a1547e13e8e82203d2049b15b1a"]
.unchecked_into(),
//5EUNaBpX9mJgcmLQHyG5Pkms6tbDiKuLbeTEJS924Js9cA1N
hex!["6a8570b9c6408e54bacf123cc2bb1b0f087f9c149147d0005badba63a5a4ac01"]
.unchecked_into(),
Expand All @@ -560,9 +525,6 @@ fn rococo_staging_testnet_config_genesis() -> serde_json::Value {
//5GzDPGbUM9uH52ZEwydasTj8edokGUJ7vEpoFWp9FE1YNuFB
hex!["d9c056c98ca0e6b4eb7f5c58c007c1db7be0fe1f3776108f797dd4990d1ccc33"]
.unchecked_into(),
//5GWZbVkJEfWZ7fRca39YAQeqri2Z7pkeHyd7rUctUHyQifLp
hex!["c4a980da30939d5bb9e4a734d12bf81259ae286aa21fa4b65405347fa40eff35"]
.unchecked_into(),
//5CmLCFeSurRXXtwMmLcVo7sdJ9EqDguvJbuCYDcHkr3cpqyE
hex!["1efc23c0b51ad609ab670ecf45807e31acbd8e7e5cb7c07cf49ee42992d2867c"]
.unchecked_into(),
Expand All @@ -587,9 +549,6 @@ fn rococo_staging_testnet_config_genesis() -> serde_json::Value {
//5DnEySxbnppWEyN8cCLqvGjAorGdLRg2VmkY96dbJ1LHFK8N
hex!["4bea0b37e0cce9bddd80835fa2bfd5606f5dcfb8388bbb10b10c483f0856cf14"]
.unchecked_into(),
//5E1Y1FJ7dVP7qtE3wm241pTm72rTMcDT5Jd8Czv7Pwp7N3AH
hex!["560d90ca51e9c9481b8a9810060e04d0708d246714960439f804e5c6f40ca651"]
.unchecked_into(),
//5CAC278tFCHAeHYqE51FTWYxHmeLcENSS1RG77EFRTvPZMJT
hex!["042f07fc5268f13c026bbe199d63e6ac77a0c2a780f71cda05cee5a6f1b3f11f"]
.unchecked_into(),
Expand All @@ -614,9 +573,6 @@ fn rococo_staging_testnet_config_genesis() -> serde_json::Value {
//5DrA2fZdzmNqT5j6DXNwVxPBjDV9jhkAqvjt6Us3bQHKy3cF
hex!["4ee66173993dd0db5d628c4c9cb61a27b76611ad3c3925947f0d0011ee2c5dcc"]
.unchecked_into(),
//5FNFDUGNLUtqg5LgrwYLNmBiGoP8KRxsvQpBkc7GQP6qaBUG
hex!["92156f54a114ee191415898f2da013d9db6a5362d6b36330d5fc23e27360ab66"]
.unchecked_into(),
//5Gx6YeNhynqn8qkda9QKpc9S7oDr4sBrfAu516d3sPpEt26F
hex!["d822d4088b20dca29a580a577a97d6f024bb24c9550bebdfd7d2d18e946a1c7d"]
.unchecked_into(),
Expand Down Expand Up @@ -657,7 +613,6 @@ fn rococo_staging_testnet_config_genesis() -> serde_json::Value {
x.5.clone(),
x.6.clone(),
x.7.clone(),
x.8.clone(),
),
)
})
Expand Down Expand Up @@ -768,35 +723,24 @@ pub fn get_authority_keys_from_seed(
AccountId,
BabeId,
GrandpaId,
ImOnlineId,
ValidatorId,
AssignmentId,
AuthorityDiscoveryId,
BeefyId,
) {
let keys = get_authority_keys_from_seed_no_beefy(seed);
(keys.0, keys.1, keys.2, keys.3, keys.4, keys.5, keys.6, keys.7, get_from_seed::<BeefyId>(seed))
(keys.0, keys.1, keys.2, keys.3, keys.4, keys.5, keys.6, get_from_seed::<BeefyId>(seed))
}

/// Helper function to generate stash, controller and session key from seed
pub fn get_authority_keys_from_seed_no_beefy(
seed: &str,
) -> (
AccountId,
AccountId,
BabeId,
GrandpaId,
ImOnlineId,
ValidatorId,
AssignmentId,
AuthorityDiscoveryId,
) {
) -> (AccountId, AccountId, BabeId, GrandpaId, ValidatorId, AssignmentId, AuthorityDiscoveryId) {
(
get_account_id_from_seed::<sr25519::Public>(&format!("{}//stash", seed)),
get_account_id_from_seed::<sr25519::Public>(seed),
get_from_seed::<BabeId>(seed),
get_from_seed::<GrandpaId>(seed),
get_from_seed::<ImOnlineId>(seed),
get_from_seed::<ValidatorId>(seed),
get_from_seed::<AssignmentId>(seed),
get_from_seed::<AuthorityDiscoveryId>(seed),
Expand Down Expand Up @@ -829,7 +773,6 @@ pub fn westend_testnet_genesis(
AccountId,
BabeId,
GrandpaId,
ImOnlineId,
ValidatorId,
AssignmentId,
AuthorityDiscoveryId,
Expand Down Expand Up @@ -861,7 +804,6 @@ pub fn westend_testnet_genesis(
x.5.clone(),
x.6.clone(),
x.7.clone(),
x.8.clone(),
),
)
})
Expand Down Expand Up @@ -899,7 +841,6 @@ pub fn rococo_testnet_genesis(
AccountId,
BabeId,
GrandpaId,
ImOnlineId,
ValidatorId,
AssignmentId,
AuthorityDiscoveryId,
Expand Down Expand Up @@ -930,7 +871,6 @@ pub fn rococo_testnet_genesis(
x.5.clone(),
x.6.clone(),
x.7.clone(),
x.8.clone(),
),
)
})
Expand Down
Loading

0 comments on commit c5f211d

Please sign in to comment.