mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 16:17:59 +00:00
aura, babe: don't allow disabled validators to build blocks (#9414)
* frame-support: add trait for checking disabled validators * pallet-session: implement DisabledValidators trait * pallet-babe: check for disabled validators * pallet-babe: add test for disabled validators * pallet-aura: check for disabled validators * pallet-aura: add test for disabled validators * runtime: fix missing DisableValidator * test-runtime: add missing DisabledValidators * frame-support: clean up doc Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -244,3 +244,16 @@ pub trait ValidatorRegistration<ValidatorId> {
|
||||
/// module
|
||||
fn is_registered(id: &ValidatorId) -> bool;
|
||||
}
|
||||
|
||||
/// Trait used to check whether a given validator is currently disabled and should not be
|
||||
/// participating in consensus (e.g. because they equivocated).
|
||||
pub trait DisabledValidators {
|
||||
/// Returns true if the given validator is disabled.
|
||||
fn is_disabled(index: u32) -> bool;
|
||||
}
|
||||
|
||||
impl DisabledValidators for () {
|
||||
fn is_disabled(_index: u32) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user