Skip to content

Commit

Permalink
Merge pull request #1108 from opentensor/spiigot/fix-commit-onexact-e…
Browse files Browse the repository at this point in the history
…poch

Spiigot/fix commit on exact epoch
  • Loading branch information
sam0x17 authored Jan 2, 2025
2 parents 80150de + 3988e11 commit d261f67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// `spec_version`, and `authoring_version` are the same between Wasm and native.
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
// the compatible custom types.
spec_version: 217,
spec_version: 218,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down

0 comments on commit d261f67

Please sign in to comment.