@@ -17,7 +17,7 @@ def liquid_alpha_call_params(netuid: int, alpha_values: str):
17
17
18
18
def test_liquid_alpha (local_chain , subtensor , alice_wallet ):
19
19
"""
20
- Test the liquid alpha mechanism
20
+ Test the liquid alpha mechanism. By June 17 2025 the limits are `0.025 <= alpha_low <= alpha_high <= 1`
21
21
22
22
Steps:
23
23
1. Register a subnet through Alice
@@ -79,7 +79,7 @@ def test_liquid_alpha(local_chain, subtensor, alice_wallet):
79
79
).liquid_alpha_enabled , "Failed to enable liquid alpha"
80
80
81
81
# Attempt to set alpha high & low after enabling the hyperparameter
82
- alpha_values = "87 , 54099"
82
+ alpha_values = "26001 , 54099"
83
83
call_params = liquid_alpha_call_params (netuid , alpha_values )
84
84
assert sudo_set_hyperparameter_values (
85
85
local_chain ,
@@ -90,16 +90,15 @@ def test_liquid_alpha(local_chain, subtensor, alice_wallet):
90
90
assert subtensor .get_subnet_hyperparameters (netuid ).alpha_high == 54099 , (
91
91
"Failed to set alpha high"
92
92
)
93
- assert subtensor .get_subnet_hyperparameters (netuid ).alpha_low == 87 , (
93
+ assert subtensor .get_subnet_hyperparameters (netuid ).alpha_low == 26001 , (
94
94
"Failed to set alpha low"
95
95
)
96
96
97
97
# Testing alpha high upper and lower bounds
98
98
99
99
# 1. Test setting Alpha_high too low
100
- alpha_high_too_low = (
101
- u16_max * 4 // 5
102
- ) - 1 # One less than the minimum acceptable value
100
+ alpha_high_too_low = 87
101
+
103
102
call_params = liquid_alpha_call_params (netuid , f"6553, { alpha_high_too_low } " )
104
103
result , error_message = sudo_set_hyperparameter_values (
105
104
local_chain ,
@@ -142,9 +141,7 @@ def test_liquid_alpha(local_chain, subtensor, alice_wallet):
142
141
assert error_message ["name" ] == "AlphaLowOutOfRange"
143
142
144
143
# 2. Test setting Alpha_low too high
145
- alpha_low_too_high = (
146
- u16_max * 4 // 5
147
- ) + 1 # One more than the maximum acceptable value
144
+ alpha_low_too_high = 53084
148
145
call_params = liquid_alpha_call_params (netuid , f"{ alpha_low_too_high } , 53083" )
149
146
result , error_message = sudo_set_hyperparameter_values (
150
147
local_chain ,
0 commit comments