Ignore empty authority changes (#13010)

When something tries to enact an authority change with an empty authority set, we will ignore this now.
This commit is contained in:
Bastian Köcher
2022-12-23 23:28:11 +01:00
committed by GitHub
parent 0edab31776
commit e053d34cc5
2 changed files with 16 additions and 0 deletions
+8
View File
@@ -153,7 +153,15 @@ impl<T: Config> Pallet<T> {
///
/// The storage will be applied immediately.
/// And aura consensus log will be appended to block's log.
///
/// This is a no-op if `new` is empty.
pub fn change_authorities(new: BoundedVec<T::AuthorityId, T::MaxAuthorities>) {
if new.is_empty() {
log::warn!(target: LOG_TARGET, "Ignoring empty authority change.");
return
}
<Authorities<T>>::put(&new);
let log = DigestItem::Consensus(