-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AHM] Revert multi-block election and slashing from staking-classic #7939
base: master
Are you sure you want to change the base?
Conversation
@@ -1874,7 +1863,6 @@ pub mod migrations { | |||
parachains_shared::migration::MigrateToV1<Runtime>, | |||
parachains_scheduler::migration::MigrateV2ToV3<Runtime>, | |||
pallet_staking::migrations::v16::MigrateV15ToV16<Runtime>, | |||
pallet_staking::migrations::v17::MigrateV16ToV17<Runtime>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In westend this has already been applied, but we can just sudo kill any storage keys created (if any). If there are any slashes it will be dropped, but for the testnet that's okay.
All GitHub workflows were cancelled due to failure one of the required jobs. |
@@ -182,9 +182,6 @@ try-runtime = [ | |||
"polkadot-sdk/try-runtime", | |||
"substrate-cli-test-utils/try-runtime", | |||
] | |||
staking-playground = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, glad to see this stuff reverted. I now have a better dual rutnime setup to test staking-next.
@@ -58,7 +58,7 @@ pub fn kitchensink_genesis( | |||
stakers: Vec<Staker>, | |||
staking_playground_config: Option<StakingPlaygroundConfig>, | |||
) -> serde_json::Value { | |||
let (validator_count, min_validator_count, dev_stakers) = match staking_playground_config { | |||
let (validator_count, min_validator_count, _dev_stakers) = match staking_playground_config { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm I don't remember this code, or how it has gotten to master :))
I thought we would revert all things related to this taking playground idea in substrate node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it was done here:
Since pallet-staking has no dev-stakers, you should remove that. The rest is harmless.
@@ -29,125 +29,6 @@ use frame_system::RawOrigin as SystemOrigin; | |||
use sp_runtime::traits::One; | |||
|
|||
benchmarks_instance_pallet! { | |||
// iteration of any number of items should only touch that many nodes and bags. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are useful, we can keep them.
@@ -84,8 +84,6 @@ pub(crate) fn generate(def: crate::SolutionDef) -> Result<TokenStream2> { | |||
Eq, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please undo this revert, it is harmless elsewhere and needed later.
@@ -33,7 +33,6 @@ pub(crate) fn codec_and_info_impl( | |||
let scale_info = scale_info_impl(&ident, &voter_type, &target_type, &weight_type, count); | |||
|
|||
quote! { | |||
impl _fepsp::codec::EncodeLike for #ident {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be kept
@@ -155,15 +154,6 @@ impl DataProviderBounds { | |||
self.size_exhausted(given_size.unwrap_or(SizeBound::zero())) | |||
} | |||
|
|||
/// Ensures the given encode-able slice meets both the length and count bounds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also seems useful and harmless to keep
<E as ElectionProvider>::MaxWinnersPerPage, | ||
<E as ElectionProvider>::MaxBackersPerWinner, | ||
<E as ElectionProviderBase>::AccountId, | ||
<E as ElectionProviderBase>::MaxWinners, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, at first I was against this revert.
My idea was that we keep these traits multi-page + capable of being bounded (having things like MaxWinners
etc), but now I now see that this can cause too much headache to get this revert done.
This will totally fuck me when I merge master, as I do need to bring a lot of it back, but I think it can be useful.
pallet-staking
+ pallet-epm
+ frame-ep-support
atm work together, and they are: unbounded, and single page
I will add a new mod multi_page
here later, which would bring in the traits needed for bounded + multi-page support.
A bit redundant code, but I can see now that it is a safe choice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but, I think we could have also kept the current version. I don't think there is time for it now anymore though..
@@ -127,23 +123,4 @@ where | |||
voter_at: impl Fn(Self::VoterIndex) -> Option<A>, | |||
target_at: impl Fn(Self::TargetIndex) -> Option<A>, | |||
) -> Result<Vec<Assignment<A, Self::Accuracy>>, Error>; | |||
|
|||
/// Sort self by the means of the given function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, please undo the revert here. 100% harmless and just less merge aissues later.
@@ -58,7 +58,6 @@ mod benchmarks { | |||
false, | |||
true, | |||
RewardDestination::Staked, | |||
pallet_staking::CurrentEra::<T>::get().unwrap_or_default(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A follow-up: we need to re-benchmark the session pallet. Atm the benchmarking is tightly coupled with pallet-staking.
Can you please make an issue for this and add to our board?
} | ||
Ok(ratio) | ||
} | ||
|
||
/// Convert some [`Supports`]s into vector of [`StakedAssignment`] | ||
pub fn supports_to_staked_assignment<A: IdentifierT>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also useful, please keep.
|
||
ElectionScore { minimal_stake, sum_stake, sum_stake_squared } | ||
ElectionScore { minimal_stake, sum_stake, sum_stake_squared } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, this file can be kept in the new format.
@@ -523,42 +486,6 @@ pub struct PagedExposureMetadata<Balance: HasCompact + codec::MaxEncodedLen> { | |||
pub page_count: Page, | |||
} | |||
|
|||
impl<Balance> PagedExposureMetadata<Balance> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am surprised we don't need these things? @Ank4n you would know better, they are related to paged exposures.
include == "*" || | ||
include == "all" || | ||
include.as_bytes() == pallet; | ||
let included = include.is_empty() || include == "*" || include.as_bytes() == pallet; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be kept, it is quite useful for benchmarking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, as noted, my origina, idea was to keep the additional traits and types in frame-election-provider-support, but I am okay to fuly revert them.
I will re-create them from the staking-next PR, as new traits, leaving everything as-is.
I have pointed out a few changes to sp-npos-elections
and solution-type
macro that can stay and are harmless.
A bit of a compromise, but since we need this by end of month, happy to go down this path.
Context
We are forking pallet-staking into
pallet-staking
(also referred as staking-classic, this is the version that will stay on RC) andpallet-staking-next
which will live on AH post AHM.Reverted PRs
Westend Migration
pallet-staking on Westend migrated to v17 with the following changes
New:
OffenceQueue
(StorageDoubleMap)OffenceRecord
OffenceQueueEras
(StorageValue)BoundedVec<EraIndex, BoundingDuration>
ProcessingOffence
(StorageValue)(Era, offending validator account, OffenceRecord)
Changed:
UnappliedSlashes
:StorageMap<K -> Era, V -> Vec<UnappliedSlash>>
StorageDoubleMap<K1 -> Era, K2 -> (validator_acc, perbill, page_index), V -> UnappliedSlash>
To revert these changes on Westend, since this is a testnet, we can simply drop any keys if present associated with the above storages, and reset storage version of
pallet-staking
to 16.For AHM migration
The
UnappliedSlashes
storage will need to be translated fromrc::staking-classic
toah::staking-next
. Bookmarking the code that can be referred for this.TODO
Exposure
toExistence
#7936.