Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge ValidatorSet into SessionInterface trait
Wrap a few too long lines

Add some docs
  • Loading branch information
liuchengxu committed Sep 25, 2020
commit db2d1a4c918331384c1fb7b5e4289c096a98e2a2
5 changes: 0 additions & 5 deletions Cargo.lock

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

18 changes: 2 additions & 16 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,7 @@ impl pallet_session::Trait for Runtime {
type WeightInfo = weights::pallet_session::WeightInfo<Runtime>;
}

impl pallet_session::historical::Trait for Runtime {
}
impl pallet_session::historical::Trait for Runtime {}

pallet_staking_reward_curve::build! {
const REWARD_CURVE: PiecewiseLinear<'static> = curve!(
Expand Down Expand Up @@ -757,23 +756,10 @@ impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime where
type OverarchingCall = Call;
}

impl pallet_im_online::ValidatorSet<<Self as pallet_session::ValidatorIdentification<<Self as frame_system::Trait>::AccountId>>::ValidatorId> for Runtime {
fn validators() -> Vec<<Self as pallet_session::ValidatorIdentification<<Self as frame_system::Trait>::AccountId>>::ValidatorId> {
Session::validators()
}
}

impl pallet_im_online::SessionInterface for Runtime {
fn current_index() -> sp_staking::SessionIndex {
Session::current_index()
}
}

impl pallet_im_online::Trait for Runtime {
type AuthorityId = ImOnlineId;
type Event = Event;
type SessionInterface = Self;
type ValidatorSet = Self;
type SessionDuration = SessionDuration;
type ReportUnresponsiveness = Offences;
type UnsignedPriority = ImOnlineUnsignedPriority;
Expand All @@ -786,7 +772,7 @@ parameter_types! {

impl pallet_offences::Trait for Runtime {
type Event = Event;
type IdentificationTuple = pallet_session::IdentificationTuple<<Self as frame_system::Trait>::AccountId, Self>;
type IdentificationTuple = pallet_session::IdentificationTuple<AccountId, Self>;
type OnOffenceHandler = Staking;
type WeightSoftLimit = OffencesWeightSoftLimit;
}
Expand Down
1 change: 0 additions & 1 deletion frame/authority-discovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ frame-system = { version = "2.0.0", default-features = false, path = "../system"
[dev-dependencies]
sp-core = { version = "2.0.0", path = "../../primitives/core" }
sp-io = { version = "2.0.0", path = "../../primitives/io" }
sp-session = { version = "2.0.0", path = "../../primitives/session" }
sp-staking = { version = "2.0.0", default-features = false, path = "../../primitives/staking" }

[features]
Expand Down
3 changes: 1 addition & 2 deletions frame/im-online/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ 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-io = { version = "2.0.0", default-features = false, path = "../../primitives/io" }
sp-session = { version = "2.0.0", default-features = false, path = "../../primitives/session" }
sp-runtime = { version = "2.0.0", default-features = false, path = "../../primitives/runtime" }
sp-staking = { version = "2.0.0", default-features = false, path = "../../primitives/staking" }
frame-support = { version = "2.0.0", default-features = false, path = "../support" }
Expand All @@ -41,11 +40,11 @@ std = [
"serde",
"pallet-session/std",
"sp-io/std",
"sp-session/std",
"sp-runtime/std",
"sp-staking/std",
"frame-support/std",
"frame-system/std",
"pallet-session/std",
"pallet-session-common/std",
]
runtime-benchmarks = ["frame-benchmarking"]
68 changes: 50 additions & 18 deletions frame/im-online/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,17 +231,39 @@ pub trait WeightInfo {
fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight;
}

/// The set of validators that are considered to be running an authority node.
pub trait ValidatorSet<ValidatorId> {
/// Returns all the validators ought to be online.
/// Trait for retrieving the session info needed for online node inspection.
///
/// This trait is used for decouple the pallet-session dependency from im-online
/// module so that the user of im-online & offences modules can pass any list of
/// validators that are considered to be online in each session, particularly useful
/// for the Substrate-based projects having their own staking implementation
/// instead of using pallet-staking directly.
pub trait SessionInterface<ValidatorId> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This trait looks good. What I meant with decoupling is to not depend on pallet_session in im-online pallet. I'd suggest we:

  1. Put this trait into primitives/session (sp-session)
  2. Put the below implementation into pallet_session, like so:
impl <T: crate::Trait> sp_session::SessionInterface<...> for crate::Module<T> {
  ...
}

So that it's implemented not for Runtime, but rather type Session = pallet_session::Module<Runtime>; That way you can write type SessionInterface = Session; in the implementation of im-online pallet.
3. Remove pallet_session dependency entirely from im-online. Perhaps this will require moving some other traits or types IdentificationTuple? to sp-session.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 1 & 2 has been done in d5a3b4f.
  • For 3, I originally planned to put trait VadalitorIdentification and IdentificationTuple in sp-session, but Parameter is in frame-support which is not allowed to be introduced in primitives. Any suggestons?

type FullIdentification: Parameter;

We might also need to move OneSessionHandler into sp-session if we want to remove pallet-session from pallet-im-online entirely.

impl<T: Trait> pallet_session::OneSessionHandler<T::AccountId> for Module<T> {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomusdrw Now it's enough to fix #7124 without any harm IMHO, but it's not much pretty clear to me how to remove pallet-session dep from im-online entirely, maybe we could create a new issue and refactor this in another PR later? ChainX is badly approaching the 2.0 upgrade, and we really need this patch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping @tomusdrw :-

/// Returns current session index.
fn current_index() -> SessionIndex;

/// Returns all the validators ought to be online in a session.
///
/// The returned validators are all expected to be running an authority node.
fn validators() -> Vec<ValidatorId>;
}

pub trait SessionInterface {
fn current_index() -> SessionIndex;
impl<T: pallet_session::Trait>
SessionInterface<<Self as ValidatorIdentification<<Self as frame_system::Trait>::AccountId>>::ValidatorId> for T
{
fn current_index() -> sp_staking::SessionIndex {
pallet_session::Module::<T>::current_index()
}
fn validators() -> Vec<<Self as ValidatorIdentification<<Self as frame_system::Trait>::AccountId>>::ValidatorId> {
pallet_session::Module::<T>::validators()
}
}

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

Expand All @@ -256,10 +278,11 @@ pub trait Trait: SendTransactionTypes<Call<Self>> + ValidatorIdentification<<Sel
/// there is a chance the authority will produce a block and they won't be necessary.
type SessionDuration: Get<Self::BlockNumber>;

type SessionInterface: SessionInterface;

/// A set of validators expected to be online.
type ValidatorSet: ValidatorSet<<Self as ValidatorIdentification<<Self as frame_system::Trait>::AccountId>>::ValidatorId>;
/// A type for retrieving the necessary session info.
///
/// This is currently used to get the session index and list of validators expected to be online.
type SessionInterface:
SessionInterface<<Self as ValidatorIdentification<<Self as frame_system::Trait>::AccountId>>::ValidatorId>;

/// A type that gives us the ability to submit unresponsiveness offence reports.
type ReportUnresponsiveness:
Expand Down Expand Up @@ -312,10 +335,11 @@ 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 as Trait>::ValidatorId` to the
/// number of blocks authored by the given authority.
/// For each session index, we keep a mapping of `<T as ValidatorIdentification<T::AccountId>>::ValidatorId`
/// 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 as ValidatorIdentification<T::AccountId>>::ValidatorId
double_map hasher(twox_64_concat) SessionIndex,
hasher(twox_64_concat) <T as ValidatorIdentification<T::AccountId>>::ValidatorId
=> u32;
}
add_extra_genesis {
Expand Down Expand Up @@ -416,7 +440,12 @@ type OffchainResult<T, A> = Result<A, OffchainErr<<T as frame_system::Trait>::Bl

/// 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: Trait + pallet_authorship::Trait> pallet_authorship::EventHandler<<T as ValidatorIdentification<T::AccountId>>::ValidatorId, T::BlockNumber> for Module<T> {
impl<T: Trait + pallet_authorship::Trait>
pallet_authorship::EventHandler<
<T as ValidatorIdentification<T::AccountId>>::ValidatorId,
T::BlockNumber,
> for Module<T>
{
fn note_author(author: <T as ValidatorIdentification<T::AccountId>>::ValidatorId) {
Self::note_authorship(author);
}
Expand All @@ -432,7 +461,7 @@ impl<T: Trait> Module<T> {
/// authored at least one block, during the current session. Otherwise
/// `false`.
pub fn is_online(authority_index: AuthIndex) -> bool {
let current_validators = T::ValidatorSet::validators();
let current_validators = T::SessionInterface::validators();

if authority_index >= current_validators.len() as u32 {
return false;
Expand All @@ -443,7 +472,10 @@ impl<T: Trait> Module<T> {
Self::is_online_aux(authority_index, authority)
}

fn is_online_aux(authority_index: AuthIndex, authority: &<T as ValidatorIdentification<T::AccountId>>::ValidatorId) -> bool {
fn is_online_aux(
authority_index: AuthIndex,
authority: &<T as ValidatorIdentification<T::AccountId>>::ValidatorId,
) -> bool {
let current_session = T::SessionInterface::current_index();

<ReceivedHeartbeats>::contains_key(&current_session, &authority_index) ||
Expand Down Expand Up @@ -480,7 +512,7 @@ impl<T: Trait> Module<T> {
}

let session_index = T::SessionInterface::current_index();
let validators_len = T::ValidatorSet::validators().len() as u32;
let validators_len = T::SessionInterface::validators().len() as u32;

Ok(Self::local_authority_keys()
.map(move |(authority_index, key)|
Expand Down Expand Up @@ -660,7 +692,7 @@ impl<T: Trait> pallet_session::OneSessionHandler<T::AccountId> for Module<T> {
fn on_before_session_ending() {
let session_index = T::SessionInterface::current_index();
let keys = Keys::<T>::get();
let current_validators = T::ValidatorSet::validators();
let current_validators = T::SessionInterface::validators();

let offenders = current_validators.into_iter().enumerate()
.filter(|(index, id)|
Expand Down
16 changes: 1 addition & 15 deletions frame/im-online/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@

use std::cell::RefCell;

use crate::{Module, Trait, ValidatorSet};
use crate::{Module, Trait};
use sp_runtime::Perbill;
use sp_staking::{SessionIndex, offence::{ReportOffence, OffenceError}};
use sp_runtime::testing::{Header, UintAuthorityId, TestXt};
use sp_runtime::traits::{IdentityLookup, BlakeTwo256, ConvertInto};
use sp_core::H256;
use frame_support::{impl_outer_origin, impl_outer_dispatch, parameter_types, weights::Weight};
use pallet_session::ValidatorIdentification;

impl_outer_origin!{
pub enum Origin for Runtime {}
Expand Down Expand Up @@ -182,23 +181,10 @@ parameter_types! {
pub const UnsignedPriority: u64 = 1 << 20;
}

impl ValidatorSet<<Self as ValidatorIdentification<u64>>::ValidatorId> for Runtime {
fn validators() -> Vec<<Self as ValidatorIdentification<u64>>::ValidatorId> {
Session::validators()
}
}

impl crate::SessionInterface for Runtime {
fn current_index() -> SessionIndex {
Session::current_index()
}
}

impl Trait for Runtime {
type AuthorityId = UintAuthorityId;
type Event = ();
type ReportUnresponsiveness = OffenceHandler;
type ValidatorSet = Self;
type SessionInterface = Self;
type SessionDuration = Period;
type UnsignedPriority = UnsignedPriority;
Expand Down
2 changes: 0 additions & 2 deletions frame/offences/benchmarking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pallet-session = { version = "2.0.0", default-features = false, path = "../../se
pallet-staking = { version = "2.0.0", default-features = false, features = ["runtime-benchmarks"], path = "../../staking" }
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" }
sp-std = { version = "2.0.0", default-features = false, path = "../../../primitives/std" }

[dev-dependencies]
Expand All @@ -51,7 +50,6 @@ std = [
"pallet-staking/std",
"sp-runtime/std",
"sp-staking/std",
"sp-session/std",
"sp-std/std",
"codec/std",
]
21 changes: 14 additions & 7 deletions frame/offences/benchmarking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@ pub trait Trait:
/// and the one required by offences.
pub trait IdTupleConvert<T: HistoricalTrait + OffencesTrait> {
/// Convert identification tuple from `historical` trait to the one expected by `offences`.
fn convert(id: IdentificationTuple<<T as frame_system::Trait>::AccountId, T>) -> <T as OffencesTrait>::IdentificationTuple;
fn convert(
id: IdentificationTuple<<T as frame_system::Trait>::AccountId, T>,
) -> <T as OffencesTrait>::IdentificationTuple;
}

impl<T: HistoricalTrait + OffencesTrait> IdTupleConvert<T> for T where
<T as OffencesTrait>::IdentificationTuple: From<IdentificationTuple<<T as frame_system::Trait>::AccountId, T>>
{
fn convert(id: IdentificationTuple<<T as frame_system::Trait>::AccountId, T>) -> <T as OffencesTrait>::IdentificationTuple {
fn convert(
id: IdentificationTuple<<T as frame_system::Trait>::AccountId, T>,
) -> <T as OffencesTrait>::IdentificationTuple {
id.into()
}
}
Expand Down Expand Up @@ -163,12 +167,15 @@ fn make_offenders<T: Trait>(num_offenders: u32, num_nominators: u32) -> Result<

Staking::<T>::start_session(0);

let validator_id_of =
<T as ValidatorIdentification<<T as frame_system::Trait>::AccountId>>::ValidatorIdOf::convert;
let full_identification_of =
<T as ValidatorIdentification<<T as frame_system::Trait>::AccountId>>::FullIdentificationOf::convert;

let id_tuples = offenders.iter()
.map(|offender|
<T as ValidatorIdentification<<T as frame_system::Trait>::AccountId>>::ValidatorIdOf::convert(offender.controller.clone())
.expect("failed to get validator id from account id"))
.map(|validator_id|
<T as ValidatorIdentification<<T as frame_system::Trait>::AccountId>>::FullIdentificationOf::convert(validator_id.clone())
.map(|offender| validator_id_of(offender.controller.clone())
.expect("failed to get validator id from account id"))
.map(|validator_id| full_identification_of(validator_id.clone())
.map(|full_id| (validator_id, full_id))
.expect("failed to convert validator id to full identification"))
.collect::<Vec<IdentificationTuple<<T as frame_system::Trait>::AccountId, T>>>();
Expand Down
13 changes: 0 additions & 13 deletions frame/offences/benchmarking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,22 +187,9 @@ impl pallet_staking::Trait for Test {
type WeightInfo = ();
}

impl pallet_im_online::ValidatorSet<<Self as pallet_session::ValidatorIdentification<AccountId>>::ValidatorId> for Test {
fn validators() -> Vec<<Self as pallet_session::ValidatorIdentification<AccountId>>::ValidatorId> {
Session::validators()
}
}

impl pallet_im_online::SessionInterface for Test {
fn current_index() -> sp_staking::SessionIndex {
Session::current_index()
}
}

impl pallet_im_online::Trait for Test {
type AuthorityId = UintAuthorityId;
type Event = Event;
type ValidatorSet = Self;
type SessionInterface = Self;
type SessionDuration = Period;
type ReportUnresponsiveness = Offences;
Expand Down
1 change: 0 additions & 1 deletion frame/session/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ impl-trait-for-tuples = "0.1.3"

[dev-dependencies]
sp-application-crypto = { version = "2.0.0", path = "../../primitives/application-crypto" }
sp-session = { version = "2.0.0", path = "../../primitives/session" }
lazy_static = "1.4.0"

[features]
Expand Down
24 changes: 24 additions & 0 deletions frame/session/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "pallet-session-common"
version = "2.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME sessions common pallet"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
sp-runtime = { version = "2.0.0", default-features = false, path = "../../../primitives/runtime" }
frame-support = { version = "2.0.0", default-features = false, path = "../../support" }

[features]
default = ["std"]
std = [
"sp-runtime/std",
"frame-support/std",
]
Loading