@@ -148,13 +148,49 @@ def get(self, item, default=None):
148
148
149
149
@dataclass
150
150
class SubnetHyperparameters (InfoBase ):
151
- """Dataclass for subnet hyperparameters."""
151
+ """
152
+ This class represents the hyperparameters for a subnet.
153
+ Attributes:
154
+ rho (int): The rate of decay of some value.
155
+ kappa (int): A constant multiplier used in calculations.
156
+ immunity_period (int): The period during which immunity is active.
157
+ min_allowed_weights (int): Minimum allowed weights.
158
+ max_weight_limit (float): Maximum weight limit.
159
+ tempo (int): The tempo or rate of operation.
160
+ min_difficulty (int): Minimum difficulty for some operations.
161
+ max_difficulty (int): Maximum difficulty for some operations.
162
+ weights_version (int): The version number of the weights used.
163
+ weights_rate_limit (int): Rate limit for processing weights.
164
+ adjustment_interval (int): Interval at which adjustments are made.
165
+ activity_cutoff (int): Activity cutoff threshold.
166
+ registration_allowed (bool): Indicates if registration is allowed.
167
+ target_regs_per_interval (int): Target number of registrations per interval.
168
+ min_burn (int): Minimum burn value.
169
+ max_burn (int): Maximum burn value.
170
+ bonds_moving_avg (int): Moving average of bonds.
171
+ max_regs_per_block (int): Maximum number of registrations per block.
172
+ serving_rate_limit (int): Limit on the rate of service.
173
+ max_validators (int): Maximum number of validators.
174
+ adjustment_alpha (int): Alpha value for adjustments.
175
+ difficulty (int): Difficulty level.
176
+ commit_reveal_period (int): Interval for commit-reveal weights.
177
+ commit_reveal_weights_enabled (bool): Flag indicating if commit-reveal weights are enabled.
178
+ alpha_high (int): High value of alpha.
179
+ alpha_low (int): Low value of alpha.
180
+ liquid_alpha_enabled (bool): Flag indicating if liquid alpha is enabled.
181
+ alpha_sigmoid_steepness (float):
182
+ yuma_version (int): Version of yuma.
183
+ subnet_is_active (bool): Indicates if subnet is active after START CALL.
184
+ transfers_enabled (bool): Flag indicating if transfers are enabled.
185
+ bonds_reset_enabled (bool): Flag indicating if bonds are reset enabled.
186
+ user_liquidity_enabled (bool): Flag indicating if user liquidity is enabled.
187
+ """
152
188
153
189
rho : int
154
190
kappa : int
155
191
immunity_period : int
156
192
min_allowed_weights : int
157
- max_weights_limit : float
193
+ max_weight_limit : float
158
194
tempo : int
159
195
min_difficulty : int
160
196
max_difficulty : int
@@ -177,43 +213,53 @@ class SubnetHyperparameters(InfoBase):
177
213
alpha_high : int
178
214
alpha_low : int
179
215
liquid_alpha_enabled : bool
180
- yuma3_enabled : bool
181
- alpha_sigmoid_steepness : int
216
+ alpha_sigmoid_steepness : float
217
+ yuma_version : int
218
+ subnet_is_active : bool
219
+ transfers_enabled : bool
220
+ bonds_reset_enabled : bool
221
+ user_liquidity_enabled : bool
182
222
183
223
@classmethod
184
224
def _fix_decoded (
185
225
cls , decoded : Union [dict , "SubnetHyperparameters" ]
186
226
) -> "SubnetHyperparameters" :
187
227
return cls (
188
- rho = decoded .get ("rho" ),
189
- kappa = decoded .get ("kappa" ),
190
- immunity_period = decoded .get ("immunity_period" ),
191
- min_allowed_weights = decoded .get ("min_allowed_weights" ),
192
- max_weights_limit = decoded .get ("max_weights_limit" ),
193
- tempo = decoded .get ("tempo" ),
194
- min_difficulty = decoded .get ("min_difficulty" ),
195
- max_difficulty = decoded .get ("max_difficulty" ),
196
- weights_version = decoded .get ("weights_version" ),
197
- weights_rate_limit = decoded .get ("weights_rate_limit" ),
198
- adjustment_interval = decoded .get ("adjustment_interval" ),
199
- activity_cutoff = decoded .get ("activity_cutoff" ),
200
- registration_allowed = decoded .get ("registration_allowed" ),
201
- target_regs_per_interval = decoded .get ("target_regs_per_interval" ),
202
- min_burn = decoded .get ("min_burn" ),
203
- max_burn = decoded .get ("max_burn" ),
204
- bonds_moving_avg = decoded .get ("bonds_moving_avg" ),
205
- max_regs_per_block = decoded .get ("max_regs_per_block" ),
206
- serving_rate_limit = decoded .get ("serving_rate_limit" ),
207
- max_validators = decoded .get ("max_validators" ),
208
- adjustment_alpha = decoded .get ("adjustment_alpha" ),
209
- difficulty = decoded .get ("difficulty" ),
210
- commit_reveal_period = decoded .get ("commit_reveal_period" ),
211
- commit_reveal_weights_enabled = decoded .get ("commit_reveal_weights_enabled" ),
212
- alpha_high = decoded .get ("alpha_high" ),
213
- alpha_low = decoded .get ("alpha_low" ),
214
- liquid_alpha_enabled = decoded .get ("liquid_alpha_enabled" ),
215
- yuma3_enabled = decoded .get ("yuma3_enabled" ),
216
- alpha_sigmoid_steepness = decoded .get ("alpha_sigmoid_steepness" ),
228
+ activity_cutoff = decoded ["activity_cutoff" ],
229
+ adjustment_alpha = decoded ["adjustment_alpha" ],
230
+ adjustment_interval = decoded ["adjustment_interval" ],
231
+ alpha_high = decoded ["alpha_high" ],
232
+ alpha_low = decoded ["alpha_low" ],
233
+ alpha_sigmoid_steepness = fixed_to_float (
234
+ decoded ["alpha_sigmoid_steepness" ], frac_bits = 32
235
+ ),
236
+ bonds_moving_avg = decoded ["bonds_moving_avg" ],
237
+ bonds_reset_enabled = decoded ["bonds_reset_enabled" ],
238
+ commit_reveal_weights_enabled = decoded ["commit_reveal_weights_enabled" ],
239
+ commit_reveal_period = decoded ["commit_reveal_period" ],
240
+ difficulty = decoded ["difficulty" ],
241
+ immunity_period = decoded ["immunity_period" ],
242
+ kappa = decoded ["kappa" ],
243
+ liquid_alpha_enabled = decoded ["liquid_alpha_enabled" ],
244
+ max_burn = decoded ["max_burn" ],
245
+ max_difficulty = decoded ["max_difficulty" ],
246
+ max_regs_per_block = decoded ["max_regs_per_block" ],
247
+ max_validators = decoded ["max_validators" ],
248
+ max_weight_limit = decoded ["max_weights_limit" ],
249
+ min_allowed_weights = decoded ["min_allowed_weights" ],
250
+ min_burn = decoded ["min_burn" ],
251
+ min_difficulty = decoded ["min_difficulty" ],
252
+ registration_allowed = decoded ["registration_allowed" ],
253
+ rho = decoded ["rho" ],
254
+ serving_rate_limit = decoded ["serving_rate_limit" ],
255
+ subnet_is_active = decoded ["subnet_is_active" ],
256
+ target_regs_per_interval = decoded ["target_regs_per_interval" ],
257
+ tempo = decoded ["tempo" ],
258
+ transfers_enabled = decoded ["transfers_enabled" ],
259
+ user_liquidity_enabled = decoded ["user_liquidity_enabled" ],
260
+ weights_rate_limit = decoded ["weights_rate_limit" ],
261
+ weights_version = decoded ["weights_version" ],
262
+ yuma_version = decoded ["yuma_version" ],
217
263
)
218
264
219
265
0 commit comments