-
Notifications
You must be signed in to change notification settings - Fork 684
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
Implementation of validator disabling strategy in the runtime #2172
Conversation
The CI pipeline was cancelled due to failure one of the required jobs. |
Ok(pos) => { | ||
// Keep the biggest offence | ||
if slash_proportion > offending[pos].1 { | ||
offending[pos].1 = slash_proportion; |
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.
|
||
let offending_threshold = | ||
T::OffendingValidatorsThreshold::get() * validators.len() as u32; | ||
|
||
if offending.len() >= offending_threshold as usize { | ||
// force a new era, to select a new validator set | ||
// force a new era, to select a new validator set. The era will be forced on the | ||
// next session |
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.
let mut rng = rand_chacha::ChaChaRng::from_seed(entropy.into()); | ||
|
||
let mut indecies_to_remove = BTreeSet::new(); | ||
for _ in 0..=desired_len.saturating_sub(validators.len()) { |
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.
} | ||
} | ||
|
||
let disabled = if disabled.len() > LIMIT { |
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.
remove_random_validators::<T>(disabled, LIMIT) | ||
} else { | ||
disabled | ||
}; |
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.
* backport cumulus changes to bridges-master * bump substrate, polkadot & cumulus * backport cumulus changes * make it build * fix runtimes: only numeric literals are supported by sp_version::runtime_version macro --------- Signed-off-by: acatangiu <adrian@parity.io>
* backport cumulus changes to bridges-master * bump substrate, polkadot & cumulus * backport cumulus changes * make it build * fix runtimes: only numeric literals are supported by sp_version::runtime_version macro --------- Signed-off-by: acatangiu <adrian@parity.io>
* backport cumulus changes to bridges-master * bump substrate, polkadot & cumulus * backport cumulus changes * make it build * fix runtimes: only numeric literals are supported by sp_version::runtime_version macro --------- Signed-off-by: acatangiu <adrian@parity.io>
* backport cumulus changes to bridges-master * bump substrate, polkadot & cumulus * backport cumulus changes * make it build * fix runtimes: only numeric literals are supported by sp_version::runtime_version macro --------- Signed-off-by: acatangiu <adrian@parity.io>
* backport cumulus changes to bridges-master * bump substrate, polkadot & cumulus * backport cumulus changes * make it build * fix runtimes: only numeric literals are supported by sp_version::runtime_version macro --------- Signed-off-by: acatangiu <adrian@parity.io>
* backport cumulus changes to bridges-master * bump substrate, polkadot & cumulus * backport cumulus changes * make it build * fix runtimes: only numeric literals are supported by sp_version::runtime_version macro --------- Signed-off-by: acatangiu <adrian@parity.io>
* backport cumulus changes to bridges-master * bump substrate, polkadot & cumulus * backport cumulus changes * make it build * fix runtimes: only numeric literals are supported by sp_version::runtime_version macro --------- Signed-off-by: acatangiu <adrian@parity.io>
* backport cumulus changes to bridges-master * bump substrate, polkadot & cumulus * backport cumulus changes * make it build * fix runtimes: only numeric literals are supported by sp_version::runtime_version macro --------- Signed-off-by: acatangiu <adrian@parity.io>
* backport cumulus changes to bridges-master * bump substrate, polkadot & cumulus * backport cumulus changes * make it build * fix runtimes: only numeric literals are supported by sp_version::runtime_version macro --------- Signed-off-by: acatangiu <adrian@parity.io>
* backport cumulus changes to bridges-master * bump substrate, polkadot & cumulus * backport cumulus changes * make it build * fix runtimes: only numeric literals are supported by sp_version::runtime_version macro --------- Signed-off-by: acatangiu <adrian@parity.io>
* backport cumulus changes to bridges-master * bump substrate, polkadot & cumulus * backport cumulus changes * make it build * fix runtimes: only numeric literals are supported by sp_version::runtime_version macro --------- Signed-off-by: acatangiu <adrian@parity.io>
This PR is a recreation of #1214 which after the transfer includes some rogue commits. Fixing it is too much hassle (there are additional merges after that) so I'm recreating it.
The strategy is described in #784 (comment). This PR outlines an initial implementation with todos.
Related to #784
Link to the PR in the old substrate repo: paritytech/substrate#14697
Things that needs to be addressed: