Skip to content

Commit

Permalink
if its the epoch block push to next epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnReedV committed Dec 19, 2024
1 parent 552fa1b commit a559691
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pallets/subtensor/src/subnets/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,11 @@ impl<T: Config> Pallet<T> {

// 5. Retrieve or initialize the VecDeque of commits for the hotkey.
let cur_block = Self::get_current_block_as_u64();
let cur_epoch = Self::get_epoch_index(netuid, cur_block);
let cur_epoch = match Self::should_run_epoch(netuid, commit_block) {
true => Self::get_epoch_index(netuid, cur_block).saturating_add(1),
false => Self::get_epoch_index(netuid, cur_block)
};

CRV3WeightCommits::<T>::try_mutate(netuid, cur_epoch, |commits| -> DispatchResult {
// 6. Verify that the number of unrevealed commits is within the allowed limit.

Expand Down

0 comments on commit a559691

Please sign in to comment.