-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Generate storage info for Pallet Staking #9864
Conversation
to pallet staking. Moved MAX_UNLOCKING_CHUNKS from being a constant to being a type called `MaxUnlockingChunks`
`MaxNominations` to allow it to be a bound for a `BoundedVec`
pallet compiles!
storage to being a runtime parameter `MaxNbOfValidators` Fixing various other compile errors
… staking-storage-info
@kianenigma does the PR look good to you? Also if possible, if you can please check the polkadot companion and add the needed tags as I don't have the permission to do so. I think that is the reason for the failed check. |
@georgesdib I personally really like this PR and have tried reviewing it in the past, but it is quite a big one and it touches some very sensitive code. Unfortunately, I can't promise when I will get the chance to do a full review, but I intend to do so. One possibility is that after doing another review, I might ask to strip down this PR to something slightly simpler so that we can review and merge it in smaller chunks. Thanks for your contribution so far. Hopefully we can push it to the finish line, and propose an onchain tip for your work. |
Thank you! |
@georgesdib unfortunately as it stands now, the scope of this PR is too big and too sensitive (staking being one of the most critical components of any network) to be reviewed and merged in a timely manner. This PR has already been open for far too long and I rather close it for now so we can move forward, but propose the following follow-ups:
Sorry for the inconvenience, and one last time, thanks for your contribution to Substrate! |
/tip medium |
1 similar comment
/tip medium |
A medium tip was successfully submitted for georgesdib (EawudhGYQCeKvpjUiXxRdn2bmSWUxkA1dndMHoYFVmQvRmi on kusama). |
Fixes part of paritytech/polkadot-sdk#323
Adding
generate_storage_info
to pallet Staking.kusama address: EawudhGYQCeKvpjUiXxRdn2bmSWUxkA1dndMHoYFVmQvRmi
Polkadot companion: paritytech/polkadot#3936
skip check-dependent-cumulus
(Need that because cumulus breaks from polkadot changes)
Summary of changes below:
Converting
Vec
toBoundedVec
andWeakBoundedVec
-> Needed to implementstorage_info
.Moving some constants to become runtime parameters:
MAX_NOMINATIONS
->MaxNominations
MAXIMUM_VOTES_PER_VOTER
->MaximumVotesPerVoter
MAX_UNLOCKING_CHUNKS
->MaxUnlockingChunks
as per @kianenigma suggestionRenaming
MaxNominatorRewardedPerValidator
toMaxRewardableIndividualExposures
as per @kianenigma suggestion (@thiolliere is that OK with you?).Implementation some needed utility functions on
BoundedVec
andWeakBoundedVec
.Implementing derive
OrdNoBound
for structs only, to avoid implementing it manually onExposure
.Using
ConstU32
as opposed to declaring inparameter_types
inline with �Replace parameter_types with ConstU32 &c. #10402The most controversial change probably, making
MaxValidatorsCount
become a runtime parameter instead of a storage item. This means, in particular, that updating that value will need a runtime configuration change as opposed to a mere extrinsic call. It also means, we always need a bound and it cannot be unset to leave it unbounded.