Skip to content

Commit a559691

Browse files
committed
if its the epoch block push to next epoch
1 parent 552fa1b commit a559691

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pallets/subtensor/src/subnets/weights.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,11 @@ impl<T: Config> Pallet<T> {
262262

263263
// 5. Retrieve or initialize the VecDeque of commits for the hotkey.
264264
let cur_block = Self::get_current_block_as_u64();
265-
let cur_epoch = Self::get_epoch_index(netuid, cur_block);
265+
let cur_epoch = match Self::should_run_epoch(netuid, commit_block) {
266+
true => Self::get_epoch_index(netuid, cur_block).saturating_add(1),
267+
false => Self::get_epoch_index(netuid, cur_block)
268+
};
269+
266270
CRV3WeightCommits::<T>::try_mutate(netuid, cur_epoch, |commits| -> DispatchResult {
267271
// 6. Verify that the number of unrevealed commits is within the allowed limit.
268272

0 commit comments

Comments
 (0)