Skip to content

Commit

Permalink
refactor: 💡 rm pallet-collator-selection
Browse files Browse the repository at this point in the history
  • Loading branch information
yooml committed Jun 18, 2024
1 parent c2cd21f commit 67f4a23
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 77 deletions.
3 changes: 0 additions & 3 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ pallet-authority-discovery = { version = "29.0.0", default-featu
pallet-authorship = { version = "29.0.0", default-features = false }
pallet-balances = { version = "29.0.0", default-features = false }
pallet-bounties = { version = "28.0.0", default-features = false }
pallet-collator-selection = { version = "10.0.0", default-features = false }
pallet-collective = { version = "29.0.0", default-features = false }
pallet-conviction-voting = { version = "29.0.0", default-features = false }
pallet-democracy = { version = "29.0.0", default-features = false }
Expand Down
45 changes: 0 additions & 45 deletions integration-tests/common/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,6 @@ pub mod asset_hub_polkadot {
parachain_id: PARA_ID.into(),
..Default::default()
},
collator_selection: asset_hub_polkadot_runtime::CollatorSelectionConfig {
invulnerables: collators::invulnerables_asset_hub_polkadot()
.iter()
.cloned()
.map(|(acc, _)| acc)
.collect(),
candidacy_bond: ED * 16,
..Default::default()
},
session: asset_hub_polkadot_runtime::SessionConfig {
keys: collators::invulnerables_asset_hub_polkadot()
.into_iter()
Expand Down Expand Up @@ -512,15 +503,6 @@ pub mod asset_hub_kusama {
parachain_id: PARA_ID.into(),
..Default::default()
},
collator_selection: asset_hub_kusama_runtime::CollatorSelectionConfig {
invulnerables: collators::invulnerables()
.iter()
.cloned()
.map(|(acc, _)| acc)
.collect(),
candidacy_bond: ED * 16,
..Default::default()
},
session: asset_hub_kusama_runtime::SessionConfig {
keys: collators::invulnerables()
.into_iter()
Expand Down Expand Up @@ -569,15 +551,6 @@ pub mod bridge_hub_polkadot {
parachain_id: PARA_ID.into(),
..Default::default()
},
collator_selection: bridge_hub_polkadot_runtime::CollatorSelectionConfig {
invulnerables: collators::invulnerables()
.iter()
.cloned()
.map(|(acc, _)| acc)
.collect(),
candidacy_bond: ED * 16,
..Default::default()
},
session: bridge_hub_polkadot_runtime::SessionConfig {
keys: collators::invulnerables()
.into_iter()
Expand Down Expand Up @@ -626,15 +599,6 @@ pub mod bridge_hub_kusama {
parachain_id: PARA_ID.into(),
..Default::default()
},
collator_selection: bridge_hub_kusama_runtime::CollatorSelectionConfig {
invulnerables: collators::invulnerables()
.iter()
.cloned()
.map(|(acc, _)| acc)
.collect(),
candidacy_bond: ED * 16,
..Default::default()
},
session: bridge_hub_kusama_runtime::SessionConfig {
keys: collators::invulnerables()
.into_iter()
Expand Down Expand Up @@ -685,15 +649,6 @@ pub mod bifrost_polkadot {
parachain_id: PARA_ID.into(),
..Default::default()
},
collator_selection: bifrost_polkadot_runtime::CollatorSelectionConfig {
invulnerables: collators::invulnerables_asset_hub_polkadot()
.iter()
.cloned()
.map(|(acc, _)| acc)
.collect(),
candidacy_bond: ED * 16,
..Default::default()
},
session: bifrost_polkadot_runtime::SessionConfig {
keys: collators::invulnerables()
.into_iter()
Expand Down
3 changes: 0 additions & 3 deletions runtime/bifrost-polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ cumulus-pallet-xcmp-queue = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-timestamp = { workspace = true }
cumulus-primitives-utility = { workspace = true }
pallet-collator-selection = { workspace = true }
parachain-info = { workspace = true }
parachains-common = { workspace = true }

Expand Down Expand Up @@ -166,7 +165,6 @@ std = [
"pallet-aura/std",
"pallet-balances/std",
"pallet-bounties/std",
"pallet-collator-selection/std",
"pallet-collective/std",
"pallet-conviction-voting/std",
"pallet-democracy/std",
Expand Down Expand Up @@ -351,7 +349,6 @@ try-runtime = [
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-bounties/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-collective/try-runtime",
"pallet-conviction-voting/try-runtime",
"pallet-democracy/try-runtime",
Expand Down
25 changes: 1 addition & 24 deletions runtime/bifrost-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ impl pallet_session::Config for Runtime {
type ShouldEndSession = ParachainStaking;
type ValidatorId = <Self as frame_system::Config>::AccountId;
// we don't have stash and controller, thus we don't need the convert as well.
type ValidatorIdOf = pallet_collator_selection::IdentityCollator;
type ValidatorIdOf = ConvertInto;
type WeightInfo = pallet_session::weights::SubstrateWeight<Runtime>;
}

Expand All @@ -1002,28 +1002,6 @@ impl pallet_aura::Config for Runtime {
type AllowMultipleBlocksPerSlot = ConstBool<false>;
}

parameter_types! {
pub const PotId: PalletId = PalletId(*b"PotStake");
pub const SessionLength: BlockNumber = 6 * HOURS;
pub const MaxInvulnerables: u32 = 100;
}

impl pallet_collator_selection::Config for Runtime {
type Currency = Balances;
type RuntimeEvent = RuntimeEvent;
// should be a multiple of session or things will get inconsistent
type KickThreshold = Period;
type MaxCandidates = MaxCandidates;
type MaxInvulnerables = MaxInvulnerables;
type PotId = PotId;
type UpdateOrigin = EnsureRoot<AccountId>;
type ValidatorId = <Self as frame_system::Config>::AccountId;
type ValidatorIdOf = pallet_collator_selection::IdentityCollator;
type ValidatorRegistration = Session;
type WeightInfo = ();
type MinEligibleCollators = ConstU32<5>;
}

// culumus runtime end

parameter_types! {
Expand Down Expand Up @@ -1843,7 +1821,6 @@ construct_runtime! {

// Collator support. the order of these 4 are important and shall not change.
Authorship: pallet_authorship = 20,
CollatorSelection: pallet_collator_selection = 21,
Session: pallet_session = 22,
Aura: pallet_aura = 23,
AuraExt: cumulus_pallet_aura_ext = 24,
Expand Down
1 change: 0 additions & 1 deletion runtime/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ cumulus-pallet-dmp-queue = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
cumulus-pallet-xcm = { workspace = true }
parachain-info = { workspace = true }
pallet-collator-selection = { workspace = true }

# Polkadot dependencies
polkadot-parachain-primitives = { workspace = true }
Expand Down

0 comments on commit 67f4a23

Please sign in to comment.