@@ -74,7 +74,7 @@ def sudo_set_hyperparameter_values(
74
74
return response .is_success
75
75
76
76
77
- async def wait_epoch (subtensor : "Subtensor" , netuid : int = 1 , times : int = 1 ):
77
+ async def wait_epoch (subtensor : "Subtensor" , netuid : int = 1 , ** kwargs ):
78
78
"""
79
79
Waits for the next epoch to start on a specific subnet.
80
80
@@ -90,7 +90,7 @@ async def wait_epoch(subtensor: "Subtensor", netuid: int = 1, times: int = 1):
90
90
raise Exception ("could not determine tempo" )
91
91
tempo = q_tempo [0 ].value
92
92
logging .info (f"tempo = { tempo } " )
93
- await wait_interval (tempo * times , subtensor , netuid )
93
+ await wait_interval (tempo , subtensor , netuid , ** kwargs )
94
94
95
95
96
96
def next_tempo (current_block : int , tempo : int , netuid : int ) -> int :
@@ -117,6 +117,7 @@ async def wait_interval(
117
117
netuid : int = 1 ,
118
118
reporting_interval : int = 1 ,
119
119
sleep : float = 0.25 ,
120
+ times : int = 1 ,
120
121
):
121
122
"""
122
123
Waits until the next tempo interval starts for a specific subnet.
@@ -126,7 +127,11 @@ async def wait_interval(
126
127
the current block number until the next tempo interval starts.
127
128
"""
128
129
current_block = subtensor .get_current_block ()
129
- next_tempo_block_start = next_tempo (current_block , tempo , netuid )
130
+ next_tempo_block_start = current_block
131
+
132
+ for _ in range (times ):
133
+ next_tempo_block_start = next_tempo (next_tempo_block_start , tempo , netuid )
134
+
130
135
last_reported = None
131
136
132
137
while current_block < next_tempo_block_start :
0 commit comments