mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Staking pallet (#373)
* initial staking pallet * add staking pallet to runtime * support session rotation for serai * optimizations & cleaning * fix deny * add serai network to initial networks * a few tweaks & comments * fix some pr comments * Rewrite validator-sets with logarithmic algorithms Uses the fact the underlying DB is sorted to achieve sorting of potential validators by stake. Removes release of deallocated stake for now. --------- Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
This commit is contained in:
@@ -254,7 +254,10 @@ pub(crate) async fn scan_tributaries<
|
||||
// TODO2: Differentiate connection errors from invariants
|
||||
Err(e) => {
|
||||
// Check if this failed because the keys were already set by someone else
|
||||
if matches!(serai.get_keys(spec.set()).await, Ok(Some(_))) {
|
||||
// TODO: hash_with_keys is latest, yet we'll remove old keys from storage
|
||||
let hash_with_keys = serai.get_latest_block_hash().await.unwrap();
|
||||
if matches!(serai.get_keys(spec.set(), hash_with_keys).await, Ok(Some(_)))
|
||||
{
|
||||
log::info!("another coordinator set key pair for {:?}", set);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user