Skip to content

Commit

Permalink
Hotfix/fix ema update (#1289)
Browse files Browse the repository at this point in the history
* spec bump

* add ema update min 1.0
  • Loading branch information
camfairchild authored Feb 13, 2025
1 parent e2b8367 commit f95810a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pallets/subtensor/src/staking/stake_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ impl<T: Config> Pallet<T> {
pub fn update_moving_price(netuid: u16) {
let alpha: I96F32 = SubnetMovingAlpha::<T>::get();
let minus_alpha: I96F32 = I96F32::saturating_from_num(1.0).saturating_sub(alpha);
let current_price: I96F32 = alpha.saturating_mul(Self::get_alpha_price(netuid));
let current_price: I96F32 = alpha
.saturating_mul(Self::get_alpha_price(netuid).min(I96F32::saturating_from_num(1.0)));
let current_moving: I96F32 =
minus_alpha.saturating_mul(Self::get_moving_alpha_price(netuid));
let new_moving: I96F32 = current_price.saturating_add(current_moving);
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,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: 233,
spec_version: 234,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down

0 comments on commit f95810a

Please sign in to comment.