-
Notifications
You must be signed in to change notification settings - Fork 2.6k
WIP: Automatic Validator count adjust with dampening #7231
WIP: Automatic Validator count adjust with dampening #7231
Conversation
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 disagree with the logic of validator count update being baked into staking.
With ValidatorCountAdjust
, you allow a user of substrate to opt out of this feature, which is good. But what if someone wants to have some update function, like the one proposed for kusama, but slightly different? this won't be possible with your API.
As recommended, I think having a type ValidatorConvert: Convert<u32, u32>
is best, but I am fine with any lgic that respects the flexibility of substrate and staking pallet and will not enforce this business of 40% on all chains.
With Convert
: For a chain that wants to opt out, they will pass in an IdentityConvert
which doesn't touch the count. It will always convert x
to x
. Kusama can have its own custom implementation, and an other chain is free to customize this.
You use the simple ()
or IdentityConvert
for substrate-node, and make a polkadot companion which sets polkadot-runtime to the same IdentityConvert
, and finally kusama-runtime to whatever is the requirements of kusama.
Let me know if you want more explanation on any of the above.
Sorry I missed the conversation about baking in the function in staking in the first commits. I think this is a good suggestion. So I will remove the boolean flag , add the |
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Yes, and this is already implemented in substrate substrate/primitives/runtime/src/traits.rs Lines 222 to 226 in 4be954a
So use this for identity. |
Closed because it's been stale for a while. |
This PR build on top of the previous work of @shawntabrizi. It implements the features in paritytech/polkadot-sdk#470. The goal is to have an automatic adjustment of the validator count when a new era starts if certain conditions are matched.
It also adds a flag to turn on/off the use of the dampening function and it adds an extra MaxValidatorCount storage item.
On top of that I added mocks and a few tests, to test the basic functioning of the dampening function.
I think a few test could be added so it would be helpfull if someone can add them. Also validation of the rules is still needed.