mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
Update Substrate (#623)
* Update to latest Substrate master (#615) * Update to latest Substrate master * Remove unneeded patch + warning * Update `Cargo.lock` * Fix tests * Update again * Bump Substrate (#616) * Update lock * Fix * Few fixes * Bump to latest Substrate * Fixes * fix pre-tx-pool compilation * more compilation fixes * Updates for the injection period - Liberal slash-refunding - Instant unbonding * *: Enable refactored authority discovery (#624) * *: Enable authority discovery module * *: List authority discovery id after parachain validator id Make sure existing key types don't change their order by appending the authority discovery id instead of injecting it between im online id and parachain validator id. * *: Gate authority discovery module behind feature flag * cli/src/lib.rs: Fix warnings * cli/src/lib.rs: Shorten line length * Bump Substrate * Bump Substrate * Line widths * Line widths again * Revert bump.
This commit is contained in:
@@ -53,6 +53,7 @@ use frame_support::{
|
||||
weights::{Weight, DispatchInfo},
|
||||
};
|
||||
use im_online::sr25519::AuthorityId as ImOnlineId;
|
||||
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
|
||||
use system::offchain::TransactionSubmitter;
|
||||
use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
|
||||
|
||||
@@ -96,7 +97,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
spec_name: create_runtime_str!("kusama"),
|
||||
impl_name: create_runtime_str!("parity-kusama"),
|
||||
authoring_version: 2,
|
||||
spec_version: 1019,
|
||||
spec_version: 1020,
|
||||
impl_version: 0,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
};
|
||||
@@ -258,6 +259,7 @@ impl_opaque_keys! {
|
||||
pub babe: Babe,
|
||||
pub im_online: ImOnline,
|
||||
pub parachain_validator: Parachains,
|
||||
pub authority_discovery: AuthorityDiscovery,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,7 +300,9 @@ parameter_types! {
|
||||
pub const SessionsPerEra: SessionIndex = 6;
|
||||
// 28 eras for unbonding (28 days).
|
||||
// KUSAMA: This value is 1/4 of what we expect for the mainnet.
|
||||
pub const BondingDuration: staking::EraIndex = 7;
|
||||
// KUSAMA-launch: 0 for managing the spooning injection.
|
||||
pub const BondingDuration: staking::EraIndex = 0;
|
||||
pub const SlashDeferDuration: staking::EraIndex = 7;
|
||||
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
|
||||
}
|
||||
|
||||
@@ -311,6 +315,11 @@ impl staking::Trait for Runtime {
|
||||
type Reward = ();
|
||||
type SessionsPerEra = SessionsPerEra;
|
||||
type BondingDuration = BondingDuration;
|
||||
type SlashDeferDuration = SlashDeferDuration;
|
||||
// A super-majority of the council can cancel the slash.
|
||||
// KUSAMA-launch: Any council member can remove a slash.
|
||||
// type SlashCancelOrigin = collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>;
|
||||
type SlashCancelOrigin = collective::EnsureMember<AccountId, CouncilCollective>;
|
||||
type SessionInterface = Self;
|
||||
type Time = Timestamp;
|
||||
type RewardCurve = RewardCurve;
|
||||
@@ -429,6 +438,8 @@ impl offences::Trait for Runtime {
|
||||
type OnOffenceHandler = Staking;
|
||||
}
|
||||
|
||||
impl authority_discovery::Trait for Runtime {}
|
||||
|
||||
type SubmitTransaction = TransactionSubmitter<ImOnlineId, Runtime, UncheckedExtrinsic>;
|
||||
|
||||
parameter_types! {
|
||||
@@ -568,6 +579,7 @@ construct_runtime!(
|
||||
FinalityTracker: finality_tracker::{Module, Call, Inherent},
|
||||
Grandpa: grandpa::{Module, Call, Storage, Config, Event},
|
||||
ImOnline: im_online::{Module, Call, Storage, Event<T>, ValidateUnsigned, Config<T>},
|
||||
AuthorityDiscovery: authority_discovery::{Module, Call, Config},
|
||||
|
||||
// Governance stuff; uncallable initially.
|
||||
Democracy: democracy::{Module, Call, Storage, Config, Event<T>},
|
||||
@@ -730,6 +742,12 @@ sr_api::impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl authority_discovery_primitives::AuthorityDiscoveryApi<Block> for Runtime {
|
||||
fn authorities() -> Vec<AuthorityDiscoveryId> {
|
||||
AuthorityDiscovery::authorities()
|
||||
}
|
||||
}
|
||||
|
||||
impl substrate_session::SessionKeys<Block> for Runtime {
|
||||
fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {
|
||||
SessionKeys::generate(seed)
|
||||
|
||||
@@ -1040,6 +1040,7 @@ mod tests {
|
||||
parameter_types! {
|
||||
pub const SessionsPerEra: sr_staking_primitives::SessionIndex = 6;
|
||||
pub const BondingDuration: staking::EraIndex = 28;
|
||||
pub const SlashDeferDuration: staking::EraIndex = 7;
|
||||
pub const AttestationPeriod: BlockNumber = 100;
|
||||
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
|
||||
}
|
||||
@@ -1053,6 +1054,8 @@ mod tests {
|
||||
type Reward = ();
|
||||
type SessionsPerEra = SessionsPerEra;
|
||||
type BondingDuration = BondingDuration;
|
||||
type SlashDeferDuration = SlashDeferDuration;
|
||||
type SlashCancelOrigin = system::EnsureRoot<Self::AccountId>;
|
||||
type SessionInterface = Self;
|
||||
type Time = timestamp::Module<Test>;
|
||||
type RewardCurve = RewardCurve;
|
||||
@@ -2035,7 +2038,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn empty_trie_root_const_is_blake2_hashed_null_node() {
|
||||
let hashed_null_node = <NodeCodec<Blake2Hasher> as trie_db::NodeCodec>::hashed_null_node();
|
||||
let hashed_null_node = <NodeCodec<Blake2Hasher> as trie_db::NodeCodec>::hashed_null_node();
|
||||
assert_eq!(hashed_null_node, EMPTY_TRIE_ROOT.into())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user