Add assignment keys to session keys, no separate approvals key (#2092)

* guide: merge backing and approval keys

* bump substrate master & update primitives

* use new SessionInfo struct in session_info

* session keys upgrade for Polkadot

* kusama & westend runtimes

* bump westend, kusama, and polkadot versions

* add session key to rococo & test-runtime

* update prepare-test-net to latest subkey

* update chain specs to support new para_assignment session key

* get cargo.lock from master

* formatting

* update kill_storage based on substrate master

* fix test-service

* assgn -> asgn

* use session info module for assignment session key
This commit is contained in:
Robert Habermeier
2020-12-10 20:30:27 -06:00
committed by GitHub
parent 04e9489da6
commit 15c253117d
15 changed files with 328 additions and 97 deletions
+30 -1
View File
@@ -27,7 +27,7 @@ pub mod impls;
pub mod paras_sudo_wrapper;
pub mod paras_registrar;
use primitives::v1::{BlockNumber, ValidatorId};
use primitives::v1::{BlockNumber, ValidatorId, AssignmentId};
use sp_runtime::{Perquintill, Perbill, FixedPointNumber};
use frame_system::limits;
use frame_support::{
@@ -158,6 +158,35 @@ impl<T: pallet_session::Config>
fn on_disabled(_: usize) { }
}
/// A placeholder since there is currently no provided session key handler for parachain validator
/// keys.
pub struct AssignmentSessionKeyPlaceholder<T>(sp_std::marker::PhantomData<T>);
impl<T> sp_runtime::BoundToRuntimeAppPublic for AssignmentSessionKeyPlaceholder<T> {
type Public = AssignmentId;
}
impl<T: pallet_session::Config>
pallet_session::OneSessionHandler<T::AccountId> for AssignmentSessionKeyPlaceholder<T>
{
type Key = AssignmentId;
fn on_genesis_session<'a, I: 'a>(_validators: I) where
I: Iterator<Item = (&'a T::AccountId, AssignmentId)>,
T::AccountId: 'a
{
}
fn on_new_session<'a, I: 'a>(_changed: bool, _v: I, _q: I) where
I: Iterator<Item = (&'a T::AccountId, AssignmentId)>,
T::AccountId: 'a
{
}
fn on_disabled(_: usize) { }
}
#[cfg(test)]
mod multiplier_tests {
use super::*;