Skip to content

Commit a4d6dfd

Browse files
committed
separate params in SubnetInfo
1 parent 39b4fae commit a4d6dfd

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pallets/subtensor/src/subnet_info.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use frame_support::pallet_prelude::{Decode, Encode};
33
use frame_support::storage::IterableStorageMap;
44
extern crate alloc;
55
use codec::Compact;
6-
use substrate_fixed::types::I32F32;
76

87
#[derive(Decode, Encode, PartialEq, Eq, Clone, Debug)]
98
pub struct SubnetInfo<T: Config> {
@@ -25,7 +24,8 @@ pub struct SubnetInfo<T: Config> {
2524
emission_values: Compact<u64>,
2625
burn: Compact<u64>,
2726
owner: T::AccountId,
28-
alpha_values: (I32F32, I32F32),
27+
alpha_low: Compact<u16>,
28+
alpha_high: Compact<u16>,
2929
}
3030

3131
#[derive(Decode, Encode, PartialEq, Eq, Clone, Debug)]
@@ -55,6 +55,8 @@ pub struct SubnetHyperparams {
5555
commit_reveal_weights_interval: Compact<u64>,
5656
commit_reveal_weights_enabled: bool,
5757
liquid_alpha_enabled: bool,
58+
alpha_low: Compact<u16>,
59+
alpha_high: Compact<u16>,
5860
}
5961

6062
impl<T: Config> Pallet<T> {
@@ -78,6 +80,7 @@ impl<T: Config> Pallet<T> {
7880
let network_modality = <NetworkModality<T>>::get(netuid);
7981
let emission_values = Self::get_emission_value(netuid);
8082
let burn: Compact<u64> = Self::get_burn_as_u64(netuid).into();
83+
let (alpha_low, alpha_high): (u16, u16) = Self::get_alpha_values(netuid);
8184

8285
// DEPRECATED
8386
let network_connect: Vec<[u16; 2]> = Vec::<[u16; 2]>::new();
@@ -104,7 +107,8 @@ impl<T: Config> Pallet<T> {
104107
emission_values: emission_values.into(),
105108
burn,
106109
owner: Self::get_subnet_owner(netuid),
107-
alpha_values: Self::get_alpha_values_32(netuid),
110+
alpha_low: alpha_low.into(),
111+
alpha_high: alpha_high.into(),
108112
})
109113
}
110114

@@ -160,6 +164,7 @@ impl<T: Config> Pallet<T> {
160164
let commit_reveal_weights_interval = Self::get_commit_reveal_weights_interval(netuid);
161165
let commit_reveal_weights_enabled = Self::get_commit_reveal_weights_enabled(netuid);
162166
let liquid_alpha_enabled = Self::get_liquid_alpha_enabled(netuid);
167+
let (alpha_low, alpha_high): (u16, u16) = Self::get_alpha_values(netuid);
163168

164169
Some(SubnetHyperparams {
165170
rho: rho.into(),
@@ -187,6 +192,8 @@ impl<T: Config> Pallet<T> {
187192
commit_reveal_weights_interval: commit_reveal_weights_interval.into(),
188193
commit_reveal_weights_enabled,
189194
liquid_alpha_enabled,
195+
alpha_low: alpha_low.into(),
196+
alpha_high: alpha_high.into(),
190197
})
191198
}
192199
}

0 commit comments

Comments
 (0)