Changes made
In previous version things were fine. In this change, I added pallet-staking
in the collator.
Here Staking
is pallet_staking::{Pallet,...}
Configured
pallet_staking
with reference ( but is not exactly same ) as polkadot/kusama-runtimeConfigured
pallet_authorship
impl pallet_authorship::Config for Runtime {
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Aura>;
type UncleGenerations = UncleGenerations;
type FilterUncle = ();
type EventHandler = (Staking,); //TODO: use ImOnline as second field of tuple
}
- Configures
pallet_session
impl pallet_session::Config for Runtime {
type Event = Event;
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_staking::StashOf<Self>;
type ShouldEndSession = pallet_session::PeriodicSessions<Period, Offset>;
type NextSessionRotation = pallet_session::PeriodicSessions<Period, Offset>;
type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, Staking>;
// Essentially just Aura, but lets be pedantic.
type SessionHandler = <SessionKeys as sp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
type Keys = SessionKeys;
type WeightInfo = pallet_session::weights::SubstrateWeight<Runtime>;
}
impl pallet_session_historical::Config for Runtime {
type FullIdentification = pallet_staking::Exposure<AccountId, Balance>;
type FullIdentificationOf = pallet_staking::ExposureOf<Runtime>;
}
- Chain spec config of staking:
staking: StakingConfig {
invulnerables: invulnerables.clone().iter().map(|(acc, _aura)| acc).cloned().collect(),
validator_count: invulnerables.len() as u32,
minimum_validator_count: 2,
slash_reward_fraction: Perbill::from_percent(10),
..Default::default()
},
Problem
Now when starting this collator with help of polkadot-launch
collator is not producing even the #1 block while relaychain was producing more than 100.
Alternatives
But running previous version of collator the same way which had not pallet-staking and then upgrading the chain with parachainSystem.enactAuthorize
do continue to produce block.
Note: I have not yet tested the staking behaviour but any suggestion will be welcome