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

@@ -13,7 +13,10 @@ pub mod pallet {
use serai_primitives::{NetworkId, Amount, PublicKey};
use validator_sets_pallet::{primitives::Session, Config as VsConfig, Pallet as VsPallet};
use validator_sets_pallet::{
primitives::{Session, ValidatorSet},
Config as VsConfig, Pallet as VsPallet,
};
use pallet_session::{Config as SessionConfig, SessionManager};
#[pallet::error]
@@ -183,7 +186,12 @@ pub mod pallet {
Some(VsPallet::<T>::select_validators(NetworkId::Serai))
}
fn end_session(_end_index: u32) {}
fn end_session(end_index: u32) {
VsPallet::<T>::retire_set(ValidatorSet {
network: NetworkId::Serai,
session: Session(end_index),
})
}
fn start_session(_start_index: u32) {}
}