@@ -311,6 +311,11 @@ pub mod pallet {
311
311
vec ! [ ]
312
312
}
313
313
#[ pallet:: type_value]
314
+ /// Default pending childkeys
315
+ pub fn DefaultPendingChildkeys < T : Config > ( ) -> ( Vec < ( u64 , T :: AccountId ) > , u64 ) {
316
+ ( vec ! [ ] , 0 )
317
+ }
318
+ #[ pallet:: type_value]
314
319
/// Default account linkage
315
320
pub fn DefaultProportion < T : Config > ( ) -> u64 {
316
321
0
@@ -576,7 +581,7 @@ pub mod pallet {
576
581
}
577
582
#[ pallet:: type_value]
578
583
/// Default minimum stake for weights.
579
- pub fn DefaultWeightsMinStake < T : Config > ( ) -> u64 {
584
+ pub fn DefaultStakeThreshold < T : Config > ( ) -> u64 {
580
585
0
581
586
}
582
587
#[ pallet:: type_value]
@@ -677,6 +682,18 @@ pub mod pallet {
677
682
T :: InitialColdkeySwapScheduleDuration :: get ( )
678
683
}
679
684
685
+ #[ pallet:: type_value]
686
+ /// Default value for applying pending items (e.g. childkeys).
687
+ pub fn DefaultPendingCooldown < T : Config > ( ) -> u64 {
688
+ 7200
689
+ }
690
+
691
+ #[ pallet:: type_value]
692
+ /// Default minimum stake for setting childkeys.
693
+ pub fn DefaultChildkeysMinStake < T : Config > ( ) -> u64 {
694
+ 1_000_000_000_000
695
+ }
696
+
680
697
#[ pallet:: storage]
681
698
pub type ColdkeySwapScheduleDuration < T : Config > =
682
699
StorageValue < _ , BlockNumberFor < T > , ValueQuery , DefaultColdkeySwapScheduleDuration < T > > ;
@@ -824,6 +841,18 @@ pub mod pallet {
824
841
DefaultStakeDelta < T > ,
825
842
> ;
826
843
#[ pallet:: storage]
844
+ /// DMAP ( netuid, parent ) --> (Vec<(proportion,child)>, cool_down_block)
845
+ pub type PendingChildKeys < T : Config > = StorageDoubleMap <
846
+ _ ,
847
+ Identity ,
848
+ u16 ,
849
+ Blake2_128Concat ,
850
+ T :: AccountId ,
851
+ ( Vec < ( u64 , T :: AccountId ) > , u64 ) ,
852
+ ValueQuery ,
853
+ DefaultPendingChildkeys < T > ,
854
+ > ;
855
+ #[ pallet:: storage]
827
856
/// DMAP ( parent, netuid ) --> Vec<(proportion,child)>
828
857
pub type ChildKeys < T : Config > = StorageDoubleMap <
829
858
_ ,
@@ -1270,7 +1299,7 @@ pub mod pallet {
1270
1299
StorageMap < _ , Identity , T :: AccountId , u64 , ValueQuery , DefaultLastTxBlock < T > > ;
1271
1300
#[ pallet:: storage]
1272
1301
/// ITEM( weights_min_stake )
1273
- pub type WeightsMinStake < T > = StorageValue < _ , u64 , ValueQuery , DefaultWeightsMinStake < T > > ;
1302
+ pub type StakeThreshold < T > = StorageValue < _ , u64 , ValueQuery , DefaultStakeThreshold < T > > ;
1274
1303
#[ pallet:: storage]
1275
1304
/// --- MAP (netuid, who) --> VecDeque<(hash, commit_block, first_reveal_block, last_reveal_block)> | Stores a queue of commits for an account on a given netuid.
1276
1305
pub type WeightCommits < T : Config > = StorageDoubleMap <
@@ -1342,7 +1371,7 @@ pub mod pallet {
1342
1371
/// Is the caller allowed to set weights
1343
1372
pub fn check_weights_min_stake ( hotkey : & T :: AccountId , netuid : u16 ) -> bool {
1344
1373
// Blacklist weights transactions for low stake peers.
1345
- Self :: get_stake_for_hotkey_on_subnet ( hotkey, netuid) >= Self :: get_weights_min_stake ( )
1374
+ Self :: get_stake_for_hotkey_on_subnet ( hotkey, netuid) >= Self :: get_stake_threshold ( )
1346
1375
}
1347
1376
1348
1377
/// Helper function to check if register is allowed
0 commit comments