Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Decouple the session validators from im-online #7127

Merged
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
33b105b
Decouple the session validators from im-online
liuchengxu Sep 17, 2020
d5ce27f
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Sep 18, 2020
1070e51
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Sep 20, 2020
526dbd7
.
liuchengxu Sep 20, 2020
5f1ab56
Add SessionInterface trait in im-online
liuchengxu Sep 23, 2020
451179d
Merge branch 'make-im-online-validator-set-flexiable' of https://gith…
liuchengxu Sep 24, 2020
725ca92
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Sep 24, 2020
141b27b
Fix merging issue
liuchengxu Sep 24, 2020
9bed321
Make all compile
liuchengxu Sep 24, 2020
1582b7b
Fix tests
liuchengxu Sep 24, 2020
8fded12
Avoid using frame dep in primitives via pallet-session-common
liuchengxu Sep 24, 2020
db2d1a4
Merge ValidatorSet into SessionInterface trait
liuchengxu Sep 24, 2020
9f1344d
Move pallet-sesion-common into pallet-session
liuchengxu Sep 25, 2020
d5a3b4f
Move SessionInterface to sp-session and impl it in session pallet
liuchengxu Sep 25, 2020
004bde7
Split put historical::FullValidatorIdentification trait
liuchengxu Sep 26, 2020
c395c81
Fix line width
liuchengxu Sep 26, 2020
550632d
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Sep 26, 2020
4ebb2ef
Fix staking mock
liuchengxu Sep 26, 2020
5a92424
Fix session doc test
liuchengxu Sep 26, 2020
90efb67
Simplify <T as ValidatorIdentification<AccountId>>::ValidatorId as Va…
liuchengxu Sep 27, 2020
1a71e3e
Nits
liuchengxu Sep 27, 2020
e1abd33
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Oct 5, 2020
ee947a5
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Oct 18, 2020
f274541
Clean up.
tomusdrw Oct 19, 2020
c87f862
Make it compile by commenting out report_offence_im_online bench
liuchengxu Oct 22, 2020
1840186
Tests
liuchengxu Oct 22, 2020
da2d4a5
Nits
liuchengxu Oct 22, 2020
58e9fcc
Move OneSessionHandler to sp-session
liuchengxu Oct 22, 2020
7066c13
Fix tests
liuchengxu Oct 22, 2020
9eea0a3
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Oct 22, 2020
1848bd7
Add some docs
liuchengxu Oct 22, 2020
650f279
.
liuchengxu Oct 23, 2020
ee81bf1
Fix typo
liuchengxu Oct 23, 2020
e7598a3
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Oct 28, 2020
ff94e6b
Rename to ValidatorSet::session_index()
liuchengxu Oct 28, 2020
7d5cceb
Add some more docs
liuchengxu Oct 28, 2020
de08937
.
liuchengxu Oct 28, 2020
e28377b
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Oct 28, 2020
6e07546
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Oct 31, 2020
6c42cc8
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Nov 2, 2020
fe9e17a
Remove extra empty line
liuchengxu Nov 2, 2020
3fdb3c4
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Nov 3, 2020
6d8defa
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Nov 4, 2020
aef33ca
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Nov 9, 2020
b919689
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Jan 4, 2021
516afb2
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Jan 14, 2021
c4158d7
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Jan 20, 2021
ea357a3
Fix line width check
liuchengxu Jan 20, 2021
6937b72
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Jan 21, 2021
7a265af
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Jan 24, 2021
d4787ad
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Jan 25, 2021
2c007d0
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Jan 27, 2021
a34f75c
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Feb 1, 2021
04f247c
Merge branch 'make-im-online-validator-set-flexiable' of https://gith…
liuchengxu Feb 1, 2021
865bfd8
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Feb 2, 2021
0a39d79
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Feb 2, 2021
e8c8ce5
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Feb 2, 2021
12ff709
Apply suggestions from code review
liuchengxu Feb 2, 2021
12324f3
Cleaup Cargo.toml
liuchengxu Feb 2, 2021
3551036
Aura has migrated to Pallet now
liuchengxu Feb 2, 2021
8e392fa
Merge branch 'master' of https://github.com/paritytech/substrate into…
liuchengxu Feb 2, 2021
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
5 changes: 5 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime where
impl pallet_im_online::Config for Runtime {
type AuthorityId = ImOnlineId;
type Event = Event;
type ValidatorSet = Historical;
type SessionDuration = SessionDuration;
type ReportUnresponsiveness = Offences;
type UnsignedPriority = ImOnlineUnsignedPriority;
Expand Down
2 changes: 2 additions & 0 deletions frame/aura/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ sp-std = { version = "2.0.0", default-features = false, path = "../../primitives
serde = { version = "1.0.101", optional = true }
pallet-session = { version = "2.0.0", default-features = false, path = "../session" }
sp-runtime = { version = "2.0.0", default-features = false, path = "../../primitives/runtime" }
sp-session = { version = "2.0.0", default-features = false, path = "../../primitives/session" }
frame-support = { version = "2.0.0", default-features = false, path = "../support" }
sp-consensus-aura = { version = "0.8.0", path = "../../primitives/consensus/aura", default-features = false }
frame-system = { version = "2.0.0", default-features = false, path = "../system" }
Expand All @@ -41,6 +42,7 @@ std = [
"sp-std/std",
"serde",
"sp-runtime/std",
"sp-session/std",
"frame-support/std",
"sp-consensus-aura/std",
"frame-system/std",
Expand Down
2 changes: 1 addition & 1 deletion frame/aura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl<T: Config> sp_runtime::BoundToRuntimeAppPublic for Pallet<T> {
type Public = T::AuthorityId;
}

impl<T: Config> pallet_session::OneSessionHandler<T::AccountId> for Pallet<T> {
impl<T: Config> sp_session::OneSessionHandler<T::AccountId> for Module<T> {
type Key = T::AuthorityId;

fn on_genesis_session<'a, I: 'a>(validators: I)
Expand Down
2 changes: 2 additions & 0 deletions frame/authority-discovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ sp-std = { version = "2.0.0", default-features = false, path = "../../primitives
serde = { version = "1.0.101", optional = true }
pallet-session = { version = "2.0.0", features = ["historical" ], path = "../session", default-features = false }
sp-runtime = { version = "2.0.0", default-features = false, path = "../../primitives/runtime" }
sp-session = { version = "2.0.0", default-features = false, path = "../../primitives/session" }
frame-support = { version = "2.0.0", default-features = false, path = "../support" }
frame-system = { version = "2.0.0", default-features = false, path = "../system" }

Expand All @@ -38,6 +39,7 @@ std = [
"serde",
"pallet-session/std",
"sp-runtime/std",
"sp-session/std",
"frame-support/std",
"frame-system/std",
]
4 changes: 2 additions & 2 deletions frame/authority-discovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl<T: Config> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
type Public = AuthorityId;
}

impl<T: Config> pallet_session::OneSessionHandler<T::AccountId> for Module<T> {
impl<T: Config> sp_session::OneSessionHandler<T::AccountId> for Module<T> {
type Key = AuthorityId;

fn on_genesis_session<'a, I: 'a>(authorities: I)
Expand Down Expand Up @@ -265,7 +265,7 @@ mod tests {
let mut externalities = TestExternalities::new(t);

externalities.execute_with(|| {
use pallet_session::OneSessionHandler;
use sp_session::OneSessionHandler;

AuthorityDiscovery::on_genesis_session(
first_authorities.iter().map(|id| (id, id.clone()))
Expand Down
4 changes: 2 additions & 2 deletions frame/babe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use sp_runtime::{
traits::{Hash, IsMember, One, SaturatedConversion, Saturating},
ConsensusEngineId, KeyTypeId,
};
use sp_session::{GetSessionNumber, GetValidatorCount};
use sp_session::{GetSessionNumber, GetValidatorCount, OneSessionHandler};
use sp_std::{prelude::*, result};
use sp_timestamp::OnTimestampSet;

Expand Down Expand Up @@ -769,7 +769,7 @@ impl<T: Config> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
type Public = AuthorityId;
}

impl<T: Config> pallet_session::OneSessionHandler<T::AccountId> for Module<T> {
impl<T: Config> OneSessionHandler<T::AccountId> for Module<T> {
type Key = AuthorityId;

fn on_genesis_session<'a, I: 'a>(validators: I)
Expand Down
4 changes: 2 additions & 2 deletions frame/grandpa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ use sp_runtime::{
traits::Zero,
DispatchResult, KeyTypeId,
};
use sp_session::{GetSessionNumber, GetValidatorCount};
use sp_session::{GetSessionNumber, GetValidatorCount, OneSessionHandler};
use sp_staking::SessionIndex;

mod equivocation;
Expand Down Expand Up @@ -587,7 +587,7 @@ impl<T: Config> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
type Public = AuthorityId;
}

impl<T: Config> pallet_session::OneSessionHandler<T::AccountId> for Module<T>
impl<T: Config> OneSessionHandler<T::AccountId> for Module<T>
where T: pallet_session::Config
{
type Key = AuthorityId;
Expand Down
2 changes: 1 addition & 1 deletion frame/grandpa/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use frame_support::{
weights::{GetDispatchInfo, Pays},
};
use frame_system::{EventRecord, Phase};
use pallet_session::OneSessionHandler;
use sp_session::OneSessionHandler;
use sp_core::H256;
use sp_keyring::Ed25519Keyring;
use sp_runtime::testing::Digest;
Expand Down
9 changes: 6 additions & 3 deletions frame/im-online/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,31 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features =
sp-core = { version = "2.0.0", default-features = false, path = "../../primitives/core" }
sp-std = { version = "2.0.0", default-features = false, path = "../../primitives/std" }
serde = { version = "1.0.101", optional = true }
pallet-session = { version = "2.0.0", default-features = false, path = "../session" }
sp-io = { version = "2.0.0", default-features = false, path = "../../primitives/io" }
liuchengxu marked this conversation as resolved.
Show resolved Hide resolved
sp-runtime = { version = "2.0.0", default-features = false, path = "../../primitives/runtime" }
sp-staking = { version = "2.0.0", default-features = false, path = "../../primitives/staking" }
sp-session = { version = "2.0.0", default-features = false, path = "../../primitives/session" }
frame-support = { version = "2.0.0", default-features = false, path = "../support" }
frame-system = { version = "2.0.0", default-features = false, path = "../system" }

frame-benchmarking = { version = "2.0.0", default-features = false, path = "../benchmarking", optional = true }

[dev-dependencies]
pallet-session = { version = "2.0.0", path = "../session" }

[features]
default = ["std", "pallet-session/historical"]
default = ["std"]
std = [
"sp-application-crypto/std",
"pallet-authorship/std",
"codec/std",
"sp-core/std",
"sp-std/std",
"serde",
"pallet-session/std",
"sp-io/std",
"sp-runtime/std",
"sp-staking/std",
"sp-session/std",
"frame-support/std",
"frame-system/std",
]
Expand Down
70 changes: 47 additions & 23 deletions frame/im-online/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ use codec::{Encode, Decode};
use sp_core::offchain::OpaqueNetworkState;
use sp_std::prelude::*;
use sp_std::convert::TryInto;
use pallet_session::historical::IdentificationTuple;
use sp_runtime::{
offchain::storage::StorageValueRef,
RuntimeDebug,
Expand All @@ -93,6 +92,7 @@ use sp_staking::{
SessionIndex,
offence::{ReportOffence, Offence, Kind},
};
use sp_session::{ValidatorSet, ValidatorSetWithIdentification};
use frame_support::{
decl_module, decl_event, decl_storage, Parameter, debug, decl_error,
traits::Get,
Expand Down Expand Up @@ -227,7 +227,19 @@ pub struct Heartbeat<BlockNumber>
pub validators_len: u32,
}

pub trait Config: SendTransactionTypes<Call<Self>> + pallet_session::historical::Config {
/// A type for representing the validator id in a session.
pub type ValidatorId<T> = <
liuchengxu marked this conversation as resolved.
Show resolved Hide resolved
<T as Config>::ValidatorSet as ValidatorSet<<T as frame_system::Config>::AccountId>
>::ValidatorId;

/// A tuple of (ValidatorId, Identification) where `Identification` is the full identification of `ValidatorId`.
pub type IdentificationTuple<T> = (
ValidatorId<T>,
<<T as Config>::ValidatorSet as
ValidatorSetWithIdentification<<T as frame_system::Config>::AccountId>>::Identification,
);

pub trait Config: SendTransactionTypes<Call<Self>> + frame_system::Config {
/// The identifier type for an authority.
type AuthorityId: Member + Parameter + RuntimeAppPublic + Default + Ord;

Expand All @@ -242,6 +254,13 @@ pub trait Config: SendTransactionTypes<Call<Self>> + pallet_session::historical:
/// there is a chance the authority will produce a block and they won't be necessary.
type SessionDuration: Get<Self::BlockNumber>;

/// A type for retrieving the validators supposed to be online in a session.
///
/// This is used for decoupling the pallet-session dependency since the user of this
/// module might have their own definition for the set of expected online validators
liuchengxu marked this conversation as resolved.
Show resolved Hide resolved
/// in a session.
type ValidatorSet: ValidatorSetWithIdentification<Self::AccountId>;

/// A type that gives us the ability to submit unresponsiveness offence reports.
type ReportUnresponsiveness:
ReportOffence<
Expand Down Expand Up @@ -293,10 +312,10 @@ decl_storage! {
double_map hasher(twox_64_concat) SessionIndex, hasher(twox_64_concat) AuthIndex
=> Option<Vec<u8>>;

/// For each session index, we keep a mapping of `T::ValidatorId` to the
/// For each session index, we keep a mapping of `ValidatorId<T>` to the
/// number of blocks authored by the given authority.
AuthoredBlocks get(fn authored_blocks):
double_map hasher(twox_64_concat) SessionIndex, hasher(twox_64_concat) T::ValidatorId
double_map hasher(twox_64_concat) SessionIndex, hasher(twox_64_concat) ValidatorId<T>
=> u32;
}
add_extra_genesis {
Expand Down Expand Up @@ -345,7 +364,7 @@ decl_module! {
) {
ensure_none(origin)?;

let current_session = <pallet_session::Module<T>>::current_index();
let current_session = T::ValidatorSet::session_index();
let exists = <ReceivedHeartbeats>::contains_key(
&current_session,
&heartbeat.authority_index
Expand Down Expand Up @@ -397,12 +416,15 @@ type OffchainResult<T, A> = Result<A, OffchainErr<<T as frame_system::Config>::B

/// Keep track of number of authored blocks per authority, uncles are counted as
/// well since they're a valid proof of being online.
impl<T: Config + pallet_authorship::Config> pallet_authorship::EventHandler<T::ValidatorId, T::BlockNumber> for Module<T> {
fn note_author(author: T::ValidatorId) {
impl<
T: Config + pallet_authorship::Config,
> pallet_authorship::EventHandler<ValidatorId<T>, T::BlockNumber> for Module<T>
{
fn note_author(author: ValidatorId<T>) {
Self::note_authorship(author);
}

fn note_uncle(author: T::ValidatorId, _age: T::BlockNumber) {
fn note_uncle(author: ValidatorId<T>, _age: T::BlockNumber) {
Self::note_authorship(author);
}
}
Expand All @@ -413,7 +435,7 @@ impl<T: Config> Module<T> {
/// authored at least one block, during the current session. Otherwise
/// `false`.
pub fn is_online(authority_index: AuthIndex) -> bool {
let current_validators = <pallet_session::Module<T>>::validators();
let current_validators = T::ValidatorSet::validators();

if authority_index >= current_validators.len() as u32 {
return false;
Expand All @@ -424,8 +446,8 @@ impl<T: Config> Module<T> {
Self::is_online_aux(authority_index, authority)
}

fn is_online_aux(authority_index: AuthIndex, authority: &T::ValidatorId) -> bool {
let current_session = <pallet_session::Module<T>>::current_index();
fn is_online_aux(authority_index: AuthIndex, authority: &ValidatorId<T>) -> bool {
let current_session = T::ValidatorSet::session_index();

<ReceivedHeartbeats>::contains_key(&current_session, &authority_index) ||
<AuthoredBlocks<T>>::get(
Expand All @@ -437,13 +459,13 @@ impl<T: Config> Module<T> {
/// Returns `true` if a heartbeat has been received for the authority at `authority_index` in
/// the authorities series, during the current session. Otherwise `false`.
pub fn received_heartbeat_in_current_session(authority_index: AuthIndex) -> bool {
let current_session = <pallet_session::Module<T>>::current_index();
let current_session = T::ValidatorSet::session_index();
<ReceivedHeartbeats>::contains_key(&current_session, &authority_index)
}

/// Note that the given authority has authored a block in the current session.
fn note_authorship(author: T::ValidatorId) {
let current_session = <pallet_session::Module<T>>::current_index();
fn note_authorship(author: ValidatorId<T>) {
let current_session = T::ValidatorSet::session_index();

<AuthoredBlocks<T>>::mutate(
&current_session,
Expand All @@ -460,8 +482,8 @@ impl<T: Config> Module<T> {
return Err(OffchainErr::TooEarly(heartbeat_after))
}

let session_index = <pallet_session::Module<T>>::current_index();
let validators_len = <pallet_session::Module<T>>::validators().len() as u32;
let session_index = T::ValidatorSet::session_index();
let validators_len = T::ValidatorSet::validators().len() as u32;
liuchengxu marked this conversation as resolved.
Show resolved Hide resolved

Ok(Self::local_authority_keys()
.map(move |(authority_index, key)|
Expand Down Expand Up @@ -614,7 +636,7 @@ impl<T: Config> sp_runtime::BoundToRuntimeAppPublic for Module<T> {
type Public = T::AuthorityId;
}

impl<T: Config> pallet_session::OneSessionHandler<T::AccountId> for Module<T> {
impl<T: Config> sp_session::OneSessionHandler<T::AccountId> for Module<T> {
type Key = T::AuthorityId;

fn on_genesis_session<'a, I: 'a>(validators: I)
Expand All @@ -639,22 +661,24 @@ impl<T: Config> pallet_session::OneSessionHandler<T::AccountId> for Module<T> {
}

fn on_before_session_ending() {
let session_index = <pallet_session::Module<T>>::current_index();
let session_index = T::ValidatorSet::session_index();
let keys = Keys::<T>::get();
let current_validators = <pallet_session::Module<T>>::validators();
let current_validators = T::ValidatorSet::validators();

let offenders = current_validators.into_iter().enumerate()
.filter(|(index, id)|
!Self::is_online_aux(*index as u32, id)
).filter_map(|(_, id)|
T::FullIdentificationOf::convert(id.clone()).map(|full_id| (id, full_id))
<T::ValidatorSet as ValidatorSetWithIdentification<T::AccountId>>::IdentificationOf::convert(
id.clone()
).map(|full_id| (id, full_id))
).collect::<Vec<IdentificationTuple<T>>>();

// Remove all received heartbeats and number of authored blocks from the
// current session, they have already been processed and won't be needed
// anymore.
<ReceivedHeartbeats>::remove_prefix(&<pallet_session::Module<T>>::current_index());
<AuthoredBlocks<T>>::remove_prefix(&<pallet_session::Module<T>>::current_index());
<ReceivedHeartbeats>::remove_prefix(&T::ValidatorSet::session_index());
<AuthoredBlocks<T>>::remove_prefix(&T::ValidatorSet::session_index());

if offenders.is_empty() {
Self::deposit_event(RawEvent::AllGood);
Expand Down Expand Up @@ -691,7 +715,7 @@ impl<T: Config> frame_support::unsigned::ValidateUnsigned for Module<T> {
}

// check if session index from heartbeat is recent
let current_session = <pallet_session::Module<T>>::current_index();
let current_session = T::ValidatorSet::session_index();
if heartbeat.session_index != current_session {
return InvalidTransaction::Stale.into();
}
Expand Down
2 changes: 2 additions & 0 deletions frame/im-online/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ impl Config for Runtime {
type AuthorityId = UintAuthorityId;
type Event = ();
type ReportUnresponsiveness = OffenceHandler;
type ValidatorSet = Historical;
type SessionDuration = Period;
type UnsignedPriority = UnsignedPriority;
type WeightInfo = ();
Expand All @@ -195,6 +196,7 @@ impl<LocalCall> frame_system::offchain::SendTransactionTypes<LocalCall> for Runt
pub type ImOnline = Module<Runtime>;
pub type System = frame_system::Module<Runtime>;
pub type Session = pallet_session::Module<Runtime>;
pub type Historical = pallet_session::historical::Module<Runtime>;

pub fn advance_session() {
let now = System::block_number().max(1);
Expand Down
Loading