mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 05:11:09 +00:00
Remove v0.8.28 runtime migrations (#2496)
* remove v0.8.28 runtime migrations * Update runtime/westend/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * commit suggestions Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -29,7 +29,7 @@ use primitives::v1::{
|
|||||||
AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CommittedCandidateReceipt,
|
AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CommittedCandidateReceipt,
|
||||||
CoreState, GroupRotationInfo, Hash, Id, Moment, Nonce, OccupiedCoreAssumption,
|
CoreState, GroupRotationInfo, Hash, Id, Moment, Nonce, OccupiedCoreAssumption,
|
||||||
PersistedValidationData, Signature, ValidationCode, ValidatorId, ValidatorIndex,
|
PersistedValidationData, Signature, ValidationCode, ValidatorId, ValidatorIndex,
|
||||||
InboundDownwardMessage, InboundHrmpMessage, SessionInfo, AssignmentId,
|
InboundDownwardMessage, InboundHrmpMessage, SessionInfo,
|
||||||
};
|
};
|
||||||
use runtime_common::{
|
use runtime_common::{
|
||||||
claims, SlowAdjustingFeeUpdate, CurrencyToVote,
|
claims, SlowAdjustingFeeUpdate, CurrencyToVote,
|
||||||
@@ -266,16 +266,6 @@ parameter_types! {
|
|||||||
pub const Offset: BlockNumber = 0;
|
pub const Offset: BlockNumber = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_opaque_keys! {
|
|
||||||
pub struct OldSessionKeys {
|
|
||||||
pub grandpa: Grandpa,
|
|
||||||
pub babe: Babe,
|
|
||||||
pub im_online: ImOnline,
|
|
||||||
pub para_validator: ParachainSessionKeyPlaceholder<Runtime>,
|
|
||||||
pub authority_discovery: AuthorityDiscovery,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl_opaque_keys! {
|
impl_opaque_keys! {
|
||||||
pub struct SessionKeys {
|
pub struct SessionKeys {
|
||||||
pub grandpa: Grandpa,
|
pub grandpa: Grandpa,
|
||||||
@@ -287,25 +277,6 @@ impl_opaque_keys! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn transform_session_keys(v: AccountId, old: OldSessionKeys) -> SessionKeys {
|
|
||||||
SessionKeys {
|
|
||||||
grandpa: old.grandpa,
|
|
||||||
babe: old.babe,
|
|
||||||
im_online: old.im_online,
|
|
||||||
para_validator: old.para_validator,
|
|
||||||
para_assignment: {
|
|
||||||
// We need to produce a dummy value that's unique for the validator.
|
|
||||||
let mut id = AssignmentId::default();
|
|
||||||
let id_raw: &mut [u8] = id.as_mut();
|
|
||||||
id_raw.copy_from_slice(v.as_ref());
|
|
||||||
id_raw[0..4].copy_from_slice(b"asgn");
|
|
||||||
|
|
||||||
id
|
|
||||||
},
|
|
||||||
authority_discovery: old.authority_discovery,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
||||||
}
|
}
|
||||||
@@ -948,24 +919,10 @@ impl pallet_proxy::Config for Runtime {
|
|||||||
type AnnouncementDepositFactor = AnnouncementDepositFactor;
|
type AnnouncementDepositFactor = AnnouncementDepositFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// When this is removed, should also remove `OldSessionKeys`.
|
pub struct CustomOnRuntimeUpgrade;
|
||||||
pub struct UpgradeSessionKeys;
|
impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
|
||||||
impl frame_support::traits::OnRuntimeUpgrade for UpgradeSessionKeys {
|
|
||||||
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||||
Session::upgrade_keys::<OldSessionKeys, _>(transform_session_keys);
|
0
|
||||||
Perbill::from_percent(50) * BlockWeights::get().max_block
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct PhragmenElectionDepositRuntimeUpgrade;
|
|
||||||
impl pallet_elections_phragmen::migrations_3_0_0::V2ToV3 for PhragmenElectionDepositRuntimeUpgrade {
|
|
||||||
type AccountId = AccountId;
|
|
||||||
type Balance = Balance;
|
|
||||||
type Module = ElectionsPhragmen;
|
|
||||||
}
|
|
||||||
impl frame_support::traits::OnRuntimeUpgrade for PhragmenElectionDepositRuntimeUpgrade {
|
|
||||||
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
|
||||||
pallet_elections_phragmen::migrations_3_0_0::apply::<Self>(5 * CENTS, DOLLARS)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1071,7 +1028,7 @@ pub type Executive = frame_executive::Executive<
|
|||||||
frame_system::ChainContext<Runtime>,
|
frame_system::ChainContext<Runtime>,
|
||||||
Runtime,
|
Runtime,
|
||||||
AllModules,
|
AllModules,
|
||||||
(UpgradeSessionKeys, PhragmenElectionDepositRuntimeUpgrade)
|
()
|
||||||
>;
|
>;
|
||||||
/// The payload being signed in the transactions.
|
/// The payload being signed in the transactions.
|
||||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ use primitives::v1::{
|
|||||||
AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CommittedCandidateReceipt,
|
AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CommittedCandidateReceipt,
|
||||||
CoreState, GroupRotationInfo, Hash, Id, Moment, Nonce, OccupiedCoreAssumption,
|
CoreState, GroupRotationInfo, Hash, Id, Moment, Nonce, OccupiedCoreAssumption,
|
||||||
PersistedValidationData, Signature, ValidationCode, ValidatorId, ValidatorIndex,
|
PersistedValidationData, Signature, ValidationCode, ValidatorId, ValidatorIndex,
|
||||||
InboundDownwardMessage, InboundHrmpMessage, SessionInfo, AssignmentId,
|
InboundDownwardMessage, InboundHrmpMessage, SessionInfo,
|
||||||
};
|
};
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
create_runtime_str, generic, impl_opaque_keys, ModuleId, ApplyExtrinsicResult,
|
create_runtime_str, generic, impl_opaque_keys, ModuleId, ApplyExtrinsicResult,
|
||||||
@@ -275,16 +275,6 @@ impl pallet_authorship::Config for Runtime {
|
|||||||
type EventHandler = (Staking, ImOnline);
|
type EventHandler = (Staking, ImOnline);
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_opaque_keys! {
|
|
||||||
pub struct OldSessionKeys {
|
|
||||||
pub grandpa: Grandpa,
|
|
||||||
pub babe: Babe,
|
|
||||||
pub im_online: ImOnline,
|
|
||||||
pub para_validator: ParachainSessionKeyPlaceholder<Runtime>,
|
|
||||||
pub authority_discovery: AuthorityDiscovery,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl_opaque_keys! {
|
impl_opaque_keys! {
|
||||||
pub struct SessionKeys {
|
pub struct SessionKeys {
|
||||||
pub grandpa: Grandpa,
|
pub grandpa: Grandpa,
|
||||||
@@ -296,25 +286,6 @@ impl_opaque_keys! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn transform_session_keys(v: AccountId, old: OldSessionKeys) -> SessionKeys {
|
|
||||||
SessionKeys {
|
|
||||||
grandpa: old.grandpa,
|
|
||||||
babe: old.babe,
|
|
||||||
im_online: old.im_online,
|
|
||||||
para_validator: old.para_validator,
|
|
||||||
para_assignment: {
|
|
||||||
// We need to produce a dummy value that's unique for the validator.
|
|
||||||
let mut id = AssignmentId::default();
|
|
||||||
let id_raw: &mut [u8] = id.as_mut();
|
|
||||||
id_raw.copy_from_slice(v.as_ref());
|
|
||||||
id_raw[0..4].copy_from_slice(b"asgn");
|
|
||||||
|
|
||||||
id
|
|
||||||
},
|
|
||||||
authority_discovery: old.authority_discovery,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
||||||
}
|
}
|
||||||
@@ -952,24 +923,10 @@ impl pallet_proxy::Config for Runtime {
|
|||||||
type AnnouncementDepositFactor = AnnouncementDepositFactor;
|
type AnnouncementDepositFactor = AnnouncementDepositFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// When this is removed, should also remove `OldSessionKeys`.
|
pub struct CustomOnRuntimeUpgrade;
|
||||||
pub struct UpgradeSessionKeys;
|
impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
|
||||||
impl frame_support::traits::OnRuntimeUpgrade for UpgradeSessionKeys {
|
|
||||||
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||||
Session::upgrade_keys::<OldSessionKeys, _>(transform_session_keys);
|
0
|
||||||
Perbill::from_percent(50) * BlockWeights::get().max_block
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct PhragmenElectionDepositRuntimeUpgrade;
|
|
||||||
impl pallet_elections_phragmen::migrations_3_0_0::V2ToV3 for PhragmenElectionDepositRuntimeUpgrade {
|
|
||||||
type AccountId = AccountId;
|
|
||||||
type Balance = Balance;
|
|
||||||
type Module = ElectionsPhragmen;
|
|
||||||
}
|
|
||||||
impl frame_support::traits::OnRuntimeUpgrade for PhragmenElectionDepositRuntimeUpgrade {
|
|
||||||
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
|
||||||
pallet_elections_phragmen::migrations_3_0_0::apply::<Self>(5 * CENTS, DOLLARS)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1067,7 +1024,7 @@ pub type Executive = frame_executive::Executive<
|
|||||||
frame_system::ChainContext<Runtime>,
|
frame_system::ChainContext<Runtime>,
|
||||||
Runtime,
|
Runtime,
|
||||||
AllModules,
|
AllModules,
|
||||||
(UpgradeSessionKeys, PhragmenElectionDepositRuntimeUpgrade),
|
()
|
||||||
>;
|
>;
|
||||||
/// The payload being signed in transactions.
|
/// The payload being signed in transactions.
|
||||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ use primitives::v1::{
|
|||||||
AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CommittedCandidateReceipt,
|
AccountId, AccountIndex, Balance, BlockNumber, CandidateEvent, CommittedCandidateReceipt,
|
||||||
CoreState, GroupRotationInfo, Hash, Id, Moment, Nonce, OccupiedCoreAssumption,
|
CoreState, GroupRotationInfo, Hash, Id, Moment, Nonce, OccupiedCoreAssumption,
|
||||||
PersistedValidationData, Signature, ValidationCode, ValidatorId, ValidatorIndex,
|
PersistedValidationData, Signature, ValidationCode, ValidatorId, ValidatorIndex,
|
||||||
InboundDownwardMessage, InboundHrmpMessage, SessionInfo, AssignmentId,
|
InboundDownwardMessage, InboundHrmpMessage, SessionInfo,
|
||||||
};
|
};
|
||||||
use runtime_common::{
|
use runtime_common::{
|
||||||
SlowAdjustingFeeUpdate, CurrencyToVote,
|
SlowAdjustingFeeUpdate, CurrencyToVote,
|
||||||
@@ -257,16 +257,6 @@ parameter_types! {
|
|||||||
pub const Offset: BlockNumber = 0;
|
pub const Offset: BlockNumber = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_opaque_keys! {
|
|
||||||
pub struct OldSessionKeys {
|
|
||||||
pub grandpa: Grandpa,
|
|
||||||
pub babe: Babe,
|
|
||||||
pub im_online: ImOnline,
|
|
||||||
pub para_validator: ParachainSessionKeyPlaceholder<Runtime>,
|
|
||||||
pub authority_discovery: AuthorityDiscovery,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl_opaque_keys! {
|
impl_opaque_keys! {
|
||||||
pub struct SessionKeys {
|
pub struct SessionKeys {
|
||||||
pub grandpa: Grandpa,
|
pub grandpa: Grandpa,
|
||||||
@@ -278,25 +268,6 @@ impl_opaque_keys! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn transform_session_keys(v: AccountId, old: OldSessionKeys) -> SessionKeys {
|
|
||||||
SessionKeys {
|
|
||||||
grandpa: old.grandpa,
|
|
||||||
babe: old.babe,
|
|
||||||
im_online: old.im_online,
|
|
||||||
para_validator: old.para_validator,
|
|
||||||
para_assignment: {
|
|
||||||
// We need to produce a dummy value that's unique for the validator.
|
|
||||||
let mut id = AssignmentId::default();
|
|
||||||
let id_raw: &mut [u8] = id.as_mut();
|
|
||||||
id_raw.copy_from_slice(v.as_ref());
|
|
||||||
id_raw[0..4].copy_from_slice(b"asgn");
|
|
||||||
|
|
||||||
id
|
|
||||||
},
|
|
||||||
authority_discovery: old.authority_discovery,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
||||||
}
|
}
|
||||||
@@ -764,20 +735,11 @@ pub type Executive = frame_executive::Executive<
|
|||||||
frame_system::ChainContext<Runtime>,
|
frame_system::ChainContext<Runtime>,
|
||||||
Runtime,
|
Runtime,
|
||||||
AllModules,
|
AllModules,
|
||||||
UpgradeSessionKeys,
|
()
|
||||||
>;
|
>;
|
||||||
/// The payload being signed in transactions.
|
/// The payload being signed in transactions.
|
||||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||||
|
|
||||||
// When this is removed, should also remove `OldSessionKeys`.
|
|
||||||
pub struct UpgradeSessionKeys;
|
|
||||||
impl frame_support::traits::OnRuntimeUpgrade for UpgradeSessionKeys {
|
|
||||||
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
|
||||||
Session::upgrade_keys::<OldSessionKeys, _>(transform_session_keys);
|
|
||||||
Perbill::from_percent(50) * BlockWeights::get().max_block
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct CustomOnRuntimeUpgrade;
|
pub struct CustomOnRuntimeUpgrade;
|
||||||
impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
|
impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
|
||||||
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||||
|
|||||||
Reference in New Issue
Block a user