mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +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:
@@ -26,6 +26,7 @@ fn testnet_genesis(
|
||||
(
|
||||
key,
|
||||
key,
|
||||
// TODO: Properly diversify these?
|
||||
SessionKeys { babe: key.into(), grandpa: key.into(), authority_discovery: key.into() },
|
||||
)
|
||||
};
|
||||
@@ -54,12 +55,9 @@ fn testnet_genesis(
|
||||
},
|
||||
|
||||
validator_sets: ValidatorSetsConfig {
|
||||
bond: Amount(1_000_000 * 10_u64.pow(8)),
|
||||
networks: vec![
|
||||
(NetworkId::Bitcoin, NETWORKS[&NetworkId::Bitcoin].clone()),
|
||||
(NetworkId::Ethereum, NETWORKS[&NetworkId::Ethereum].clone()),
|
||||
(NetworkId::Monero, NETWORKS[&NetworkId::Monero].clone()),
|
||||
],
|
||||
stake: Amount(1_000_000 * 10_u64.pow(8)),
|
||||
// TODO: Array of these in primitives
|
||||
networks: vec![NetworkId::Serai, NetworkId::Bitcoin, NetworkId::Ethereum, NetworkId::Monero],
|
||||
participants: validators.iter().map(|name| account_from_name(name)).collect(),
|
||||
},
|
||||
session: SessionConfig { keys: validators.iter().map(|name| session_key(*name)).collect() },
|
||||
|
||||
Reference in New Issue
Block a user