Most of coordinator Tributary retiry

Adds Event::SetRetired to validator-sets.

Emit TributaryRetired.

Replaces is_active_set, which made multiple network requests, with
is_retired_tributary, a DB read.

Performs most of the removals necessary upon TributaryRetired.

Still needs to clean up the actual Tributary/Tendermint tasks.
This commit is contained in:
Luke Parker
2023-10-14 16:47:25 -04:00
parent 5897efd7c7
commit 3b3fdd104b
10 changed files with 145 additions and 110 deletions

View File

@@ -235,6 +235,7 @@ pub mod pallet {
pub enum Event<T: Config> {
NewSet { set: ValidatorSet },
KeyGen { set: ValidatorSet, key_pair: KeyPair },
SetRetired { set: ValidatorSet },
}
impl<T: Config> Pallet<T> {
@@ -592,10 +593,10 @@ pub mod pallet {
Self::participants(network).into()
}
pub fn retire_session(network: NetworkId, session: Session) {
let set = ValidatorSet { network, session };
pub fn retire_set(set: ValidatorSet) {
MuSigKeys::<T>::remove(set);
Keys::<T>::remove(set);
Pallet::<T>::deposit_event(Event::SetRetired { set });
}
/// Take the amount deallocatable.